Evergine 2026.5.26.921 · .NET 10 · Windows 11 · DX11 head (and WebGPU head where noted).
Desktop application: a 3D viewer for building models.
What happens
A Camera3D with its own FrameBuffer renders the entire scene into that target regardless of its layer
mask. We want it to draw exactly one render layer, so we can build a screen-space mask of selected objects.
What we expect
With LayerMaskDefaultValue = false and a single true entry, the camera draws only that layer — the way the
main camera does.
Evidence
A RenderDoc capture of one frame shows 652 colour draws and 782 depth draws into a target that should
receive one draw — model, ground grid and UI alike. Dumping the colour target confirms it: a complete render of
the scene.
At the moment of those draws the camera's state, logged from our own code, is exactly what it should be:
LayerMaskDefaultValue = False
LayerMask entries = 9 (8 explicit false, 1 true for the layer we want)
requested layer key = present, value = True
What we already ruled out
- Not the key scheme. We use
camera.LayerMask[layer.Id.GetHashCode()], and the main camera honours the
same dictionary with the same keys — its exclusions work.
- Not ordering. Tried setting the entry before and after
entityManager.Add(...).
- Not creation time. Tried building the camera during scene setup and lazily later; no difference.
- Not a missed change notification. Tried re-asserting
LayerMaskDefaultValue after attach, and writing the
entry false then true to force a change.
- Not reliance on the default. Tried naming every layer explicitly with
false rather than depending on
LayerMaskDefaultValue.
Camera.LayerBoolMask is null — but it is null on the main camera too, so that does not appear to be the
consulted state.
Questions
- Is
LayerMask supposed to apply to a camera with a FrameBuffer? If not, is that documented anywhere?
- If this is by design, what is the supported way to render a subset of the scene into a texture? A
per-camera replacement/override material, a custom render step, or a second Scene rendered to a
FrameBuffer — whichever is intended. A pointer to a sample would be ideal.
Evergine 2026.5.26.921 · .NET 10 · Windows 11 · DX11 head (and WebGPU head where noted).
Desktop application: a 3D viewer for building models.
What happens
A
Camera3Dwith its ownFrameBufferrenders the entire scene into that target regardless of its layermask. We want it to draw exactly one render layer, so we can build a screen-space mask of selected objects.
What we expect
With
LayerMaskDefaultValue = falseand a singletrueentry, the camera draws only that layer — the way themain camera does.
Evidence
A RenderDoc capture of one frame shows 652 colour draws and 782 depth draws into a target that should
receive one draw — model, ground grid and UI alike. Dumping the colour target confirms it: a complete render of
the scene.
At the moment of those draws the camera's state, logged from our own code, is exactly what it should be:
What we already ruled out
camera.LayerMask[layer.Id.GetHashCode()], and the main camera honours thesame dictionary with the same keys — its exclusions work.
entityManager.Add(...).LayerMaskDefaultValueafter attach, and writing theentry
falsethentrueto force a change.falserather than depending onLayerMaskDefaultValue.Camera.LayerBoolMaskisnull— but it is null on the main camera too, so that does not appear to be theconsulted state.
Questions
LayerMasksupposed to apply to a camera with aFrameBuffer? If not, is that documented anywhere?per-camera replacement/override material, a custom render step, or a second
Scenerendered to aFrameBuffer— whichever is intended. A pointer to a sample would be ideal.