Mechanism for inheritable render layers #12461
Labels
A-Rendering
Drawing game state to the screen
A-Scenes
Serialized ECS data stored on the disk
C-Feature
A new feature, making something new possible
D-Modest
A "normal" level of difficulty; suitable for simple features or challenging fixes
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
What problem does this solve or what need does it fill?
Currently render layers only affect the entity that they are attached to, not their descendants. This is problematic for a number of reasons: for example, if I load a GLTF scene and spawn a
SceneBundle
, I can add a render layer to the bundle, but it has no effect on the models contained within the scene. While I can manually iterate through the scene bundle and addRenderLayers
components, this doesn't help if I have multiple instances of the scene which need to appear in different layers.What solution would you like?
Because inheritance requires additional calculation, I propose adding a new optional component (or perhaps a new property on
RenderLayers
) which would cause the layer settings to apply to all descendants, except for descendants which explicitly had their own layer settings. This would operation much like the existing visibility calculations, and probably could be performed in the same tree traversal.What alternative(s) have you considered?
At the moment I'm manually iterating over descendants and adding render layers, but this adds a lot of extra complexity.
The text was updated successfully, but these errors were encountered: