@TwistedTwigleg I don't want to duplicate my mesh as in the end it will be a very dense mesh generated by script :( If you find the replacement shader tricks (for specific object of course, not all objects) it would be great !

@panicq said:

@SIsilicon28 said: You don't really need a viewport for rendering ALL depth. That should be available to you already in Viewport2.

Yes, how without the quad trick ? I don't know, but anyway it's not resolving the fact that now nothing else than depth is being rendered, as the depth shader (writing to the albedo) is taking over every other render)

The only way the quad rendering in the other viewports is if their cameras' render layers includes it too.

@SIsilicon28 said:

@panicq said:

@SIsilicon28 said: You don't really need a viewport for rendering ALL depth. That should be available to you already in Viewport2.

Yes, how without the quad trick ? I don't know, but anyway it's not resolving the fact that now nothing else than depth is being rendered, as the depth shader (writing to the albedo) is taking over every other render)

The only way the quad rendering in the other viewports is if their cameras' render layers includes it too.

Which sould be the case haha otherwise I won't render the objects :p

Ok then. Try this render layers setup.

Layer 1 - All other objects
Layer 2 - Object mask
Layer 3 - Depth quad

Camera in DepthSphere => Layer 2 | Layer 3
MeshInstance in DepthSphere => Layer 3
Camera3 => Layer 1 | Layer 2
Sphere => Layer 2

Everything else = Layer 1

Sorry I didn't read your last message because in the end I made it working by tweaking the masks. This is hacky, I don't like that at all, I hope godot 4.0 will tackle this horrible pipeline :D

Godot 4.0 should allow for user defined render passes, which should make this process much easier. I'm glad you got it working!

3 years later