Skip to content

Commit

Permalink
WebGPURenderer: Fix specularF90 of MeshStandardMaterial (#28138)
Browse files Browse the repository at this point in the history
* MeshStandardNodeMaterial: fix specularF90

* update screenshot

* update screenshots
  • Loading branch information
sunag committed Apr 15, 2024
1 parent 361f301 commit 44556ab
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/jsm/nodes/functions/PhysicalLightingModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion examples/jsm/nodes/materials/MeshStandardNodeMaterial.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -40,6 +40,7 @@ class MeshStandardNodeMaterial extends NodeMaterial {
const specularColorNode = mix( vec3( 0.04 ), diffuseColor.rgb, metalness );

specularColor.assign( specularColorNode );
specularF90.assign( 1.0 );

}

Expand Down
Binary file modified examples/screenshots/webgpu_custom_fog_background.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_loader_gltf.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_postprocessing_anamorphic.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 44556ab

Please sign in to comment.