How do I clear the depth buffer between effect composer passes?

Normally to clear the depth buffer between normal render passes, I do the following so that scene2 always renders in front of scene1:

renderer.render(scene1);
renderer.clearDepth();
renderer.render(scene2);

How do I do this with the effect composer renderPass?

composer.addPass(renderPass1);
// ??
composer.addPass(renderPass2);

I could use multiple composer instances per render pass and clear the depth buffer between their render calls but I might have to apply shaders to each composer instance that way unless I can copy the result of the first composer and use it in the second.

1 Like

It’s ok, I was able to make a custom pass that clears the depth buffer. Just extended THREE.Pass and put renderer.clearDepth() in the render call then put that custom pass between the render passes. That works fine.

2 Likes