Bladeren bron

WebGPU: Fixes (2) (#23005)

* fix min/max webgpu if used: max( vec(), float() )

* Regular direction of Dot Product
sunag 3 jaren geleden
bovenliggende
commit
213a50c877

File diff suppressed because it is too large
+ 0 - 0
examples/jsm/node-editor/examples/rim.json


+ 1 - 1
examples/jsm/renderers/nodes/functions/PhysicalMaterialFunctions.js

@@ -18,7 +18,7 @@ export const getRoughness = new ShaderNode( ( inputs ) => {
 
 	const geometryRoughness = getGeometryRoughness();
 
-	let roughnessFactor = max( roughness.r, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.
+	let roughnessFactor = max( roughness, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.
 	roughnessFactor = add( roughnessFactor, geometryRoughness );
 	roughnessFactor = min( roughnessFactor, 1.0 );
 

+ 4 - 2
examples/jsm/renderers/nodes/math/MathNode.js

@@ -127,7 +127,9 @@ class MathNode extends TempNode {
 		const b = this.bNode;
 		const c = this.cNode;
 
-		if ( builder.renderer.isWebGLRenderer === true && ( method === MathNode.DFDX || method === MathNode.DFDY ) && output === 'vec3' ) {
+		const isWebGL = builder.renderer.isWebGLRenderer === true;
+
+		if ( isWebGL && ( method === MathNode.DFDX || method === MathNode.DFDY ) && output === 'vec3' ) {
 
 			// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988
 
@@ -189,7 +191,7 @@ class MathNode extends TempNode {
 					b.build( builder, inputType )
 				);
 
-			} else if ( method === MathNode.MIN || method === MathNode.MAX || method === MathNode.MOD ) {
+			} else if ( ( isWebGL && ( method === MathNode.MIN || method === MathNode.MAX ) ) || method === MathNode.MOD ) {
 
 				params.push(
 					a.build( builder, inputType ),

Some files were not shown because too many files changed in this diff