1
0
Эх сурвалжийг харах

TSL: add `dFdx` and `dFdy` warnings (#30831)

sunag 9 сар өмнө
parent
commit
f25d5a2645

+ 8 - 0
src/nodes/math/MathNode.js

@@ -260,6 +260,14 @@ class MathNode extends TempNode {
 
 				}
 
+				if ( builder.shaderStage !== 'fragment' && ( method === MathNode.DFDX || method === MathNode.DFDY ) ) {
+
+					console.warn( `THREE.TSL: '${ method }' is not supported in the ${ builder.shaderStage } stage.` );
+
+					method = '/*' + method + '*/';
+
+				}
+
 				params.push( a.build( builder, inputType ) );
 				if ( b !== null ) params.push( b.build( builder, inputType ) );
 				if ( c !== null ) params.push( c.build( builder, inputType ) );

粤ICP备19079148号