Hey everyone!
I’m currently working on a custom render-engine primarily used in the viewport.
I noticed that blender forces a depth-pass of objects, which causes some issues with gizmos in the viewport.
This prevents things like the grid or some lines to draw properly. (EEVEE does not have this issue).
The root causes seems to be that this pass has no concept/knowledge of backface-culling, which makes sense given it’s a custom renderer.
If i force it by adding it to the flags here, it fixes the issue:
As an example, here is an inverted cube and an axis object inside drawn in EEVEE, and then with a custom renderer that actually doesn’t draw anything.
In order: EEVEE, render-engine, render-engine + backface-culling fix.
I’d like to have some option to control this, but i’m not sure what the best way would be.
The viewport shading has an option for it globally, which is absent in the material preview.
Materials settings may not apply since they are not always available for custom render-engines.
The easiest would probably be to add an optional flag in the RenderEngine struct, since globally enabling backface-culling shouldn’t cause any issues.
What would be the best option here?