Bläddra i källkod

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

* MeshStandardNodeMaterial: fix specularF90

* update screenshot

* update screenshots
sunag 1 år sedan
förälder
incheckning
44556ab610

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

@@ -383,7 +383,7 @@ class PhysicalLightingModel extends LightingModel {
 	// Approximates multiscattering in order to preserve energy.
 	// 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
 

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

@@ -1,5 +1,5 @@
 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 { materialRoughness, materialMetalness } from '../accessors/MaterialNode.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 );
 
 		specularColor.assign( specularColorNode );
+		specularF90.assign( 1.0 );
 
 	}
 

BIN
examples/screenshots/webgpu_custom_fog_background.jpg


BIN
examples/screenshots/webgpu_loader_gltf.jpg


BIN
examples/screenshots/webgpu_postprocessing_anamorphic.jpg