Godot Version
4.4.1
Context
Hi, I’m hoping to come up with a way to control what objects are processed by a screen-reading post process effect.
My setup is as follows:
- 3D scene with 3D objects and an orthogonal camera. Characters populating the scene using Sprite 3D, billboarded.
- Using the typical post process setup of a quad in front of the camera to do full screen effects.
- A second viewport and camera rendering only select layers. Piping this to the shader on the quad.
I want to be able to have a scene wide effect applied to everything but the sprite3D in the characters. I have tried splitting the layers into two viewports with linked cameras, and that gets me nearly there. However, the sprites then don’t respect occluding as they did before. Here’s an example:
The second image is what I would expect to happen. In this example, it’s very subtle, but the effect that is being masked is that faint outline shader. In the full implementation I plan on doing a full pixel art shader pass and I’d ideally have a lot of control over how that’s applied.
Question
Am I going about this the wrong way? Would I need to reimplement some kind of depth testing manually using the depth pass I get in the shader? I have seen that compositor effects are kinda new and maybe the way to do this in the future, but it also seems like I’ll need to wait for stencil buffers to be implemented (which seems soon!) to achieve what I’m going for.
I am new to Godot, loving it so far, and would appreciate anyone’s input or suggestions!
Thanks.