Pārlūkot izejas kodu

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 gadu atpakaļ
vecāks
revīzija
af36c1c8aa
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  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 ) {
 
+			const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
+
+			if ( overrideMaterial !== null ) {
+
+				return;
+
+			}
+
 			const isWebGL2 = capabilities.isWebGL2;
 
 			if ( _transmissionRenderTarget === null ) {