FAQ: What are occlusion queries ?


What are occlusion queries ?


Occlusion queries are queries in CGA code that test whether closed ('watertight') volumes overlap or touch other volumes or are inside of other volumes.

CGA stands for Computer Generated Architecture, a scripting language specific to Esri CityEngine and used to generate 3D content. See the link to the Basics of Rule-based Modeling in the Related Information section below.

It is important to note that this works only after volumes have been created (for example, after an extrude operation) or inserted (insert builtin cube).

All the volumes that were created are stored internally for the occlusion query calculations until the model generation is finished, though it is important to know that these volumes do not have to persist as shapes in the final model, but can also be split (using the component split operation) into individual shapes, which then represent the final geometry.

Since occlusion queries are computationally-intensive, all related calculations and volumes are only triggered if it is explicitly written in CGA code. It is recommended to use as few queries as possible.

If for example, a volume must be checked to see if it overlaps a street shape, the user must create a volume for the street first, then delete all the shapes except the original street shape.

attr volumeThickness = 1

Street -->
extrude (world.y, volumeThickness) # OCCLUSION VOLUME CREATED!
comp(f) {top: StreetShape | all : NIL} # delete other shapes

For further documentation, please consult the CityEngine manual. See the link to the section on occlusion queries under the CGA Shape Grammar Reference in Related Information below.

Related Information