Hello,
My setup: 1 scene, 2 cameras, firstcam
has postprocessing effect, and renderTarget to a texture to be seen by the other main camera.
But firstcam postprocessing is not visible in the resulting renderTarget texture.
Roughly, what is working (without postprocessing, I followed Three.js Render Targets):
renderTarget = new THREE.WebGLRenderTarget(512,512)
renderer.setRenderTarget(renderTarget);
renderer.render(scene, firstcam)
renderer.setRenderTarget(null);
And what is NOT working (added among code above):
var custom = new ShaderPass(effect);
custom.renderToScreen = true;
firstcam.composer.addPass(custom);
firstcam.composer.render(renderer, scene, firstcam, 0.01);
When custom
is applied to the main camera, it works fine though.
When applied to the camera used to render to target, it is ignored.
I read [Solved] How can I render a shader to a render target? - #7 by Nipson but I’d need more code to wrap my head around.
Would you please share a fiddle or codepen to understand how to use camera (or renderTarget texture) postprocessing as a texture?
Thank you very much