Skip to content

Commit

Permalink
SSRNode: Add temporary fix for Chrome.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Nov 13, 2024
1 parent b2057a3 commit 5cc2243
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/jsm/tsl/display/SSRNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class SSRNode extends TempNode {

const metalness = this.metalnessNode.uv( uvNode ).r;

// fragments with no metalness do not reflect their environment
// fragments with no metalness do not reflect their environment
metalness.equal( 0.0 ).discard();

// compute some standard FX entities
Expand Down Expand Up @@ -214,6 +214,13 @@ class SSRNode extends TempNode {
// it does not exceed d1 (the maximum ray extend)
Loop( { start: int( 0 ), end: int( this._maxStep ), type: 'int', condition: '<' }, ( { i } ) => {

// TODO: Remove this when Chrome is fixed, see https://issues.chromium.org/issues/372714384#comment14
If( metalness.equal( 0 ), () => {

Break();

} );

// stop if the maximum number of steps is reached for this specific ray
If( float( i ).greaterThanEqual( totalStep ), () => {

Expand Down

0 comments on commit 5cc2243

Please sign in to comment.