|
@@ -353,10 +353,24 @@
|
|
|
this.doRenderTarget = function ( material, output ) {
|
|
|
|
|
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
|
+ const currentXrEnabled = renderer.xr.enabled;
|
|
|
+ const currentShadowAutoUpdate = renderer.shadowMap.autoUpdate;
|
|
|
+ const currentOutputEncoding = renderer.outputEncoding;
|
|
|
+ const currentToneMapping = renderer.toneMapping;
|
|
|
+ renderer.xr.enabled = false; // Avoid camera modification
|
|
|
+
|
|
|
+ renderer.shadowMap.autoUpdate = false; // Avoid re-computing shadows
|
|
|
+
|
|
|
+ renderer.outputEncoding = THREE.LinearEncoding;
|
|
|
+ renderer.toneMapping = THREE.NoToneMapping;
|
|
|
mesh.material = material;
|
|
|
renderer.setRenderTarget( output );
|
|
|
renderer.render( scene, camera );
|
|
|
mesh.material = passThruShader;
|
|
|
+ renderer.xr.enabled = currentXrEnabled;
|
|
|
+ renderer.shadowMap.autoUpdate = currentShadowAutoUpdate;
|
|
|
+ renderer.outputEncoding = currentOutputEncoding;
|
|
|
+ renderer.toneMapping = currentToneMapping;
|
|
|
renderer.setRenderTarget( currentRenderTarget );
|
|
|
|
|
|
}; // Shaders
|