From 07c9d1acceed5595138f7d31243aa2a1ff5a14d8 Mon Sep 17 00:00:00 2001 From: theotherphil Date: Mon, 26 May 2025 20:52:22 +0100 Subject: [PATCH] Clarify RenderLayers docs (#19241) # Objective Clarify `RenderLayers` docs, to fix https://github.com/bevyengine/bevy/issues/18874 ## Solution - ## Testing - --- .../src/view/visibility/render_layers.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/crates/bevy_render/src/view/visibility/render_layers.rs b/crates/bevy_render/src/view/visibility/render_layers.rs index a5a58453e8..b39ecb215c 100644 --- a/crates/bevy_render/src/view/visibility/render_layers.rs +++ b/crates/bevy_render/src/view/visibility/render_layers.rs @@ -7,18 +7,14 @@ pub const DEFAULT_LAYERS: &RenderLayers = &RenderLayers::layer(0); /// An identifier for a rendering layer. pub type Layer = usize; -/// Describes which rendering layers an entity belongs to. +/// Defines which rendering layers an entity belongs to. /// -/// Cameras with this component will only render entities with intersecting -/// layers. +/// A camera renders an entity only when their render layers intersect. /// -/// Entities may belong to one or more layers, or no layer at all. +/// The [`Default`] instance of `RenderLayers` contains layer `0`, the first layer. Entities +/// without this component also belong to layer `0`. /// -/// The [`Default`] instance of `RenderLayers` contains layer `0`, the first layer. -/// -/// An entity with this component without any layers is invisible. -/// -/// Entities without this component belong to layer `0`. +/// An empty `RenderLayers` makes the entity invisible. #[derive(Component, Clone, Reflect, PartialEq, Eq, PartialOrd, Ord)] #[reflect(Component, Default, PartialEq, Debug, Clone)] pub struct RenderLayers(SmallVec<[u64; INLINE_BLOCKS]>);