瀏覽代碼

WebGPURenderer: Fix `specularF90` of `MeshStandardMaterial` (#28138)

* MeshStandardNodeMaterial: fix specularF90

* update screenshot

* update screenshots
sunag 1 年之前
父節點
當前提交
44556ab610

+ 1 - 1
examples/jsm/nodes/functions/PhysicalLightingModel.js

@@ -383,7 +383,7 @@ class PhysicalLightingModel extends LightingModel {
 	// Approximates multiscattering in order to preserve energy.
 	// Approximates multiscattering in order to preserve energy.
 	// http://www.jcgt.org/published/0008/01/03/
 	// http://www.jcgt.org/published/0008/01/03/
 
 
-	computeMultiscattering( singleScatter, multiScatter, specularF90 = float( 1 ) ) {
+	computeMultiscattering( singleScatter, multiScatter, specularF90 ) {
 
 
 		const dotNV = transformedNormalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
 		const dotNV = transformedNormalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
 
 

+ 2 - 1
examples/jsm/nodes/materials/MeshStandardNodeMaterial.js

@@ -1,5 +1,5 @@
 import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
 import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
-import { diffuseColor, metalness, roughness, specularColor } from '../core/PropertyNode.js';
+import { diffuseColor, metalness, roughness, specularColor, specularF90 } from '../core/PropertyNode.js';
 import { mix } from '../math/MathNode.js';
 import { mix } from '../math/MathNode.js';
 import { materialRoughness, materialMetalness } from '../accessors/MaterialNode.js';
 import { materialRoughness, materialMetalness } from '../accessors/MaterialNode.js';
 import getRoughness from '../functions/material/getRoughness.js';
 import getRoughness from '../functions/material/getRoughness.js';
@@ -40,6 +40,7 @@ class MeshStandardNodeMaterial extends NodeMaterial {
 		const specularColorNode = mix( vec3( 0.04 ), diffuseColor.rgb, metalness );
 		const specularColorNode = mix( vec3( 0.04 ), diffuseColor.rgb, metalness );
 
 
 		specularColor.assign( specularColorNode );
 		specularColor.assign( specularColorNode );
+		specularF90.assign( 1.0 );
 
 
 	}
 	}
 
 

二進制
examples/screenshots/webgpu_custom_fog_background.jpg


二進制
examples/screenshots/webgpu_loader_gltf.jpg


二進制
examples/screenshots/webgpu_postprocessing_anamorphic.jpg