What is the best way to render groups in Entities in layers? I am currently on Entities 0.17 but I have seen 0.50 adds support for RenderLayer. However, I could not find any examples or explanation on what is exactly supported.
I would like to be able to render a large amount of Entities with MeshRenderer (not SpriteRenderer and sortingLayers) and triangles in multiple groups/batches:
-
Group A
-
(Depth clear?)
-
Group B, Depth write & test: true
-
(Depth clear?)
-
Group C, Depth write & test: true
-
(Depth clear?)
-
Group D, etc…
-
…
-
Render UI, etc
I am sure this could be achieved with CameraStacking regardless the renderer, but are there better alternatives? Are there any easier or more performant alternatives? What are the limitations of each approach?
The problem with CameraStacking is, that it requires the manual setup of the layers. I would favor a more dynamic approach (just using a numeric priority), but could fallback to the static setup if really necessary.
0.50
0.11 - HybridRenderer v1
What does the documentation exactly refer to with the RenderLayer? Layered rendering via CameraStacks works in v1, but it means we are limited to a total of 32 layers and need to set them up before. Also the layers are also relevant for UnityEngine.Raycast (and I assume it translates 1:1 to Unity.Physics.Raycast):