Please separate Physics and Rendering layers

I’m not sure whether this topic should be categorized under Graphics or Physics, as it’s related to both, so I’ll post it here.

The current Layer design is the same as Unity’s, and Unity has already run into this problem. Since Layer serves the layering functions for both the Render and Physics systems, it causes unnecessary coupling. Due to Unity’s massive legacy burden, the issue has become deeply entrenched and difficult to resolve.

For related discussions, see:
Separate Physics and Rendering layers

Unity has not resolved this issue to date. When using custom RenderFeatures in URP and needing finer-grained rendering layering for objects, this coupling problem becomes particularly troublesome.

What was not actually working well were custom render buffers. I wanted to implement screen-space subsurface scattering for characters and foliage. Normally I would assign all foliage to a custom layer called Foliage, render SSS textures into a buffer and do some light calculations in a shader. Easy. What I couldn’t actually do is exactly that - assign all foliage to a new layer. This is because we already had to assign all gameobjects to either Normal or Nightmare layers.

I think they could make Normal_Foliage/Nightmare_Foliage layers (just like suggested for VFX) and use that for custom buffers rendering. Then physics and main rendering can use layer mask to include them too. With 32 layers it’s possible to make very complex games with them.

Tbh adding secondary layer to object would create a massive amount of complexity and edge cases to take care. What set of games would need it?

Also, Flax contains new Tags system which allows to use hierarchical tags (multipel per-object), which can solve many problems from code side.

Thank you for your reply.
Since I’ve only recently started trying out Flax, I’ve just realized that Flax allows an Actor to hold multiple tags. This means the issue present in Unity can be addressed in Flax using tags.

By the way, Flax is just too cool, man!

1 Like