Browse Source

Disable transmission pass if override material is enabled (#26944)

Original object materials are ignored in rendering in case an override material is used, so rendering the transmission pass is not necessary in this case.

This contribution is funded by https://higharc.com/
Olli Etuaho 1 year ago
parent
commit
af36c1c8aa
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/renderers/WebGLRenderer.js

+ 8 - 0
src/renderers/WebGLRenderer.js

@@ -1329,6 +1329,14 @@ class WebGLRenderer {
 
 
 		function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
 		function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
 
 
+			const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
+
+			if ( overrideMaterial !== null ) {
+
+				return;
+
+			}
+
 			const isWebGL2 = capabilities.isWebGL2;
 			const isWebGL2 = capabilities.isWebGL2;
 
 
 			if ( _transmissionRenderTarget === null ) {
 			if ( _transmissionRenderTarget === null ) {