I'm trying to use thee.js to only update the zbuffer (I'm using preserveDrawingBuffer to create a trace effect). However I can't find any way to only write to the zbuffer with the standard materials, so far I've tried:
visible
to false, which stops the object rendering.opacity
to 0.0, which means nothing gets rendered.Is there a 'standard' way of doing this, or do I need to use a custom fragment shader?
You can render to the depth buffer only using the following pattern.
renderer.context.colorMask( false, false, false, false ); // don't update color buffer
renderer.render( scene1, camera ); // first scene
renderer.context.colorMask( true, true, true, true );
renderer.render( scene2, camera ); // second scene
three.js r.71