I’d like to create a render pipeline using multiple render and effect passes. My use case is a complex game engine which is stacking effects like SSAO and DOF - that is working quite well though. I would like to introduce a second render pass to render transparent objects like smoke and clouds after rendering all solid objects inlcuding a SSAO postprocessing pass.
My problem is: the second render pass is not working as intended (probably because of a wrong setup).
Here is the jsfiddle:
There are 3 spheres two of them in the first render pass and a third one in the second render pass. I would like to use the depth buffer of the first render pass to continue rendering the third sphere after applying the brigthness pass (just an example effect pass).
How can i do that?
First render pass and effect pass:
Second render pass:
My goal ist to get the third sphere rendered on top of the first image (respect all depth informations).
One step closer: if i use the effect pass after the second render pass - the spheres gets combined.
I can use a dummy second effect pass to get the desired result. But there is a problem with the depth buffer - as soon as i use the first brightness effect pass - the depth buffer is gone or messed up for the second render pass.
postpro is a vanilla threejs library replacing the old effect composer in three/examples. it has nothing whatsoever to do with r3f. imo this is the perfect place to ask.
unfortunately i know too little about effect passes to answer.