瀏覽代碼

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 年之前
父節點
當前提交
af36c1c8aa
共有 1 個文件被更改,包括 8 次插入0 次删除
  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 ) {