Skip to content

Commit 9aa014f

Browse files
authored
WebGPURenderer: Improve rough reflection mixing for IBL (#32108)
* WebGPURenderer: Improve rough reflection mixing for IBL. * Updated screenshot.
1 parent b2c3aef commit 9aa014f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
-219 Bytes
Loading

src/nodes/lighting/EnvironmentNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { roughness, clearcoatRoughness } from '../core/PropertyNode.js';
44
import { cameraViewMatrix } from '../accessors/Camera.js';
55
import { normalView, clearcoatNormalView, normalWorld } from '../accessors/Normal.js';
66
import { positionViewDirection } from '../accessors/Position.js';
7-
import { float } from '../tsl/TSLBase.js';
7+
import { float, pow4 } from '../tsl/TSLBase.js';
88
import { bentNormalView } from '../accessors/AccessorsUtils.js';
99
import { pmremTexture } from '../pmrem/PMREMNode.js';
1010
import { materialEnvIntensity } from '../accessors/MaterialProperties.js';
@@ -117,7 +117,7 @@ const createRadianceContext = ( roughnessNode, normalViewNode ) => {
117117
reflectVec = positionViewDirection.negate().reflect( normalViewNode );
118118

119119
// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.
120-
reflectVec = roughnessNode.mul( roughnessNode ).mix( reflectVec, normalViewNode ).normalize();
120+
reflectVec = pow4( roughnessNode ).mix( reflectVec, normalViewNode ).normalize();
121121

122122
reflectVec = reflectVec.transformDirection( cameraViewMatrix );
123123

0 commit comments

Comments
 (0)