Skip to main content

Module visibility

Module visibility 

Source
Expand description

Components that control the visibility of entities.

§What is the difference between visibility components

There are three components that indicate various kinds of visibility modes of an entity:

Visibility is the user-defined visibility. It is the only component that users should typically add to an entity1, the other two are then added automatically.

InheritedVisibility is computed by propagation through the entity hierarchy. Entities with Visibility::Inherited copy the visibility of their parent entities. If they have no ChildOf component, they are visible. The propagation is done in visibility_propagate_system, which runs in the PostUpdate schedule.

ViewVisibility indicates whether the entity should be extracted for rendering. This component is recomputed in every frame in the PostUpdate schedule.


  1. If at all – most components that go together with Visibility already require it, so users only need to explicitly add it if they wish to override the default value of Visibility::Inherited

Structs§

CascadesVisibleEntities
CubemapVisibleEntities
DynamicSkinnedMeshBounds
Use this component to enable dynamic skinned mesh bounds. The Aabb component of the skinned mesh will be automatically updated each frame based on the current joint transforms.
InheritedVisibility
Whether or not an entity is visible in the hierarchy.
NoAutoAabb
Add this component to an entity to prevent its AABB from being automatically recomputed.
NoCpuCulling
Use this component to opt-out of the built-in CPU frustum culling, see Frustum. This can be attached to a Camera or to individual entities.
NoFrustumCulling
Use this component to opt-out of built-in frustum culling for entities, see Frustum.
RenderLayers
Defines which rendering layers an entity belongs to.
ViewVisibility
Algorithmically computed indication of whether an entity is visible and should be extracted for rendering.
VisibilityClass
A bucket into which we group entities for the purposes of visibility.
VisibilityPlugin
VisibilityRange
Specifies the range of distances that this entity must be from the camera in order to be rendered.
VisibilityRangePlugin
A plugin that enables VisibilityRanges, which allow entities to be hidden or shown based on distance to the camera.
VisibleEntities
Collection of entities visible from the current view.
VisibleEntityRanges
Stores which entities are in within the VisibilityRanges of views.
VisibleMeshEntities
Collection of mesh entities visible for 3D lighting.

Enums§

Visibility
User indication of whether an entity is visible. Propagates down the entity hierarchy.
VisibilitySystems

Constants§

DEFAULT_LAYERS

Traits§

SetViewVisibility

Functions§

add_visibility_class
A generic component add hook that automatically adds the appropriate VisibilityClass to an entity.
calculate_bounds
Computes and adds an Aabb component to entities with a Mesh3d component and without a NoFrustumCulling component.
check_visibility_cpu_culling
System updating the visibility of entities, other than those that have opted out of CPU culling, each frame.
check_visibility_gpu_culling
Updates the visibility of entities marked with NoCpuCulling.
check_visibility_ranges
Checks all entities against all views in order to determine which entities with VisibilityRanges are potentially visible.
update_frusta
Updates Frustum.

Type Aliases§

Layer
An identifier for a rendering layer.