I have the following problem: Trying to render multiple scenes for postprocessing using RenderPass.
There are 2 scenes now:
1) terrain + clouds
2) text layer
Both scenes are rendering but the text layer gets blended into the terrain (normally if they would be rendered in the same scene it should act like this). What is strange: I can see the text through the clouds which are rendered much higher than the terrain (both terrain and clouds are in the same scene for testing)
You cann see the text above the clouds but it blends to the terrain
To render it i'm using the following code:
@renderPass = new THREE.RenderPass( @scene, @camera )
@renderPass.renderToScreen = true
@renderPass.clear = false
@renderPass.clearDepth = true
@textPass = new THREE.RenderPass( @textScene, @camera )
@textPass.renderToScreen = true
@textPass.clear = false
@textPass.clearDepth = true
@composer = new THREE.EffectComposer( @renderer );
@composer.addPass( @renderPass )
@composer.addPass( @textPass )
But when Im trying to render them normally using:
@renderer.clear()
@renderer.render @scene, @camera
@renderer.clearDepth();
@renderer.render @textScene, @camera
everything works as expected.
RenderPass doesn't actually have a clearDepth
option. I opened a pull request to add support for this, which should fix your problem:
https://github.com/mrdoob/three.js/pull/10159
Update: The pull request was merged and included in the r83 release, so your code as written should now work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With