Просмотр исходного кода

GLSLNodeBuilder: Fix `CubeDepthTexture` sampler. (#32857)

Michael Herzog 4 недель назад
Родитель
Сommit
f67c8e4c34
1 измененных файлов с 11 добавлено и 1 удалено
  1. 11 1
      src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js

+ 11 - 1
src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js

@@ -752,7 +752,17 @@ ${ flowData.code }
 
 			} else if ( uniform.type === 'cubeDepthTexture' ) {
 
-				snippet = `samplerCubeShadow ${ uniform.name };`;
+				const texture = uniform.node.value;
+
+				if ( texture.compareFunction ) {
+
+					snippet = `samplerCubeShadow ${ uniform.name };`;
+
+				} else {
+
+					snippet = `samplerCube ${ uniform.name };`;
+
+				}
 
 			} else if ( uniform.type === 'buffer' ) {
 

粤ICP备19079148号