Skip to content

Commit

Permalink
WebGPURenderer: Fix Fog ColorSpace (#26424)
Browse files Browse the repository at this point in the history
* fix fog

* fix fog
  • Loading branch information
sunag committed Jul 14, 2023
1 parent 6169e48 commit 6aff9a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions examples/jsm/nodes/materials/NodeMaterial.js
Expand Up @@ -319,6 +319,12 @@ class NodeMaterial extends ShaderMaterial {

}

// FOG

const fogNode = builder.fogNode;

if ( fogNode ) outputNode = vec4( fogNode.mixAssign( outputNode.rgb ), outputNode.a );

// ENCODING

const renderTarget = renderer.getRenderTarget();
Expand All @@ -341,12 +347,6 @@ class NodeMaterial extends ShaderMaterial {

}

// FOG

const fogNode = builder.fogNode;

if ( fogNode ) outputNode = vec4( fogNode.mixAssign( outputNode.rgb ), outputNode.a );

return outputNode;

}
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_lights_phong.html
Expand Up @@ -58,7 +58,7 @@
camera.position.z = 7;

scene = new THREE.Scene();
scene.fogNode = rangeFog( color( 0xFF00FF ), 3, 30 );
scene.fogNode = rangeFog( color( 0xFF00FF ), 8, 30 );

const sphereGeometry = new THREE.SphereGeometry( 0.1, 16, 8 );

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_lights_selective.html
Expand Up @@ -60,7 +60,7 @@
camera.position.z = 7;

scene = new THREE.Scene();
scene.fogNode = rangeFog( color( 0xFF00FF ), 3, 30 );
scene.fogNode = rangeFog( color( 0xFF00FF ), 8, 30 );

const sphereGeometry = new THREE.SphereGeometry( 0.1, 16, 8 );

Expand Down

0 comments on commit 6aff9a6

Please sign in to comment.