Description
How can Bevy's documentation be improved?
The documentation of RenderLayers
in
bevy/crates/bevy_render/src/view/visibility/render_layers.rs
Lines 10 to 21 in 18e1bf1
/// Cameras with this component will only render entities with intersecting
/// layers.
This lead me to assume that a camera without this component renders entities without regard to the layer they belong to. This does not work as a camera without RenderLayers
only renders entities belonging to RenderLayers::layer(0)
.
This can be seen in
where a missingRenderLayers
is replaced with the default.
While it could be argued that the line
/// Entities without this component belong to layer `0`.
also applies to the camera this was not clear to me.
I propose expanding the camera related section of the docs to something like this:
/// Cameras with this component will only render entities with intersecting
/// layers.
/// Cameras without this component will only render entities belonging to the default render layer (RenderLayers::layer(0)).
A further improvement would be to describe how to create a camera that renders all layers (if that is even possible).
I currently create a RenderLayers
component containing all layers I use.
This feels like a workaround and is error prone because I have to remember to add new layers.