bevyengine / bevyengine/bevy

Mechanism for inheritable render layers

Open
#12,461 3 comments 14 reactions 0 assignees View on GitHub
A-Rendering A-Scenes C-Feature D-Modest S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## 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 add `RenderLayers` 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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the RenderLayers component, SceneBundle descendants, and the existing visibility tree traversal mentioned in the issue. Determine how inherited settings should interact with descendants that define their own layers; done means multiple scene instances can inherit different layer settings without manual iteration, with the behavior covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.