Display conditions are used to limit when a primitive, globe overlay, or screen overlay is rendered. This can be based on the distance from the camera to an object, such as a primitive or globe overlay, the distance from the camera to a position, the camera's altitude, pixel size, the current time, or other conditions. These fine grain conditions can be combined using Boolean logic with a composite - that is, a condition of conditions. For example, several time intervals can be or-ed together.
For efficient evaluation, primitives that share the same condition can be combined using a composite primitive. For example, 1,000 models with the same condition can be combined in a composite primitive so that they are quickly rejected. See the composite primitive overview.
Several fine grain conditions are available, including:
To improve performance, this can be used to implement a level of detail algorithm that takes into account the field of view. Several primitives with varying degrees of detail (e.g. number of vertices) are created, each with a pixel size display condition. The most detailed primitive has a pixel interval with the highest pixel sizes. Less detailed primitives have display conditions with smaller pixel sizes. When the primitive occupies many pixels, a detailed primitive is rendered. When a primitive occupies few pixels, a less detailed primitive is rendered since a user is unlikely to notice the difference between a high detail and low detail primitive when it only occupies few pixels.
A display condition is applied to an object as shown in the following code example:
When an object's DisplayCondition property is not null, the condition is evaluated before the object is rendered. The object is rendered only if the condition is met. In this case, the primitive will only be rendered if the camera's altitude is within [0, 1000] meters from the Earth's surface.
The same display condition instance can be assigned to multiple objects.
Display conditions can be combined with Boolean logic using composites, CompositeDisplayCondition. Hierarchies of composites can represent expressions with parentheses, but 9 times out of 10, simple and / or combinations of conditions will do the trick.
The following example creates a composite of conditions that allows the primitive to be rendered during two time intervals.
If a large number of conditions are added to a composite, the composite can become expensive to compute, especially if a large number of primitives have a reference to the same composite. In this case, it is recommended to put the primitives into a composite of primitives and assign the composite condition to the composite primitive.
STK Engine for UNIX 11.3.0