Skip to main content

check_visibility_cpu_culling

Function check_visibility_cpu_culling 

Source
pub fn check_visibility_cpu_culling(
    thread_queues: Local<'_, Parallel<TypeIdMap<Vec<Entity>>>>,
    view_query: Query<'_, '_, (Entity, &mut VisibleEntities, &Frustum, Option<&RenderLayers>, &Camera, Has<NoCpuCulling>)>,
    visible_aabb_query: Query<'_, '_, (Entity, &InheritedVisibility, &mut ViewVisibility, Option<&VisibilityClass>, Option<&RenderLayers>, Option<&Aabb>, Option<&Sphere>, &GlobalTransform, Has<NoFrustumCulling>, Has<VisibilityRange>), Without<NoCpuCulling>>,
    visible_entity_ranges: Option<Res<'_, VisibleEntityRanges>>,
)
Expand description

System updating the visibility of entities, other than those that have opted out of CPU culling, each frame.

The system is part of the VisibilitySystems::CheckVisibility set. Each frame, it updates the ViewVisibility of all entities, and for each view also compute the VisibleEntities for that view.

To ensure that an entity is checked for visibility, make sure that it has a VisibilityClass component and that that component is nonempty.