Skip to content

Commit

Permalink
Nodes: clean up (#28185)
Browse files Browse the repository at this point in the history
  • Loading branch information
linbingquan committed Apr 22, 2024
1 parent c817054 commit 31b2f94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/jsm/nodes/accessors/ClippingNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { positionView } from './PositionNode.js';
import { diffuseColor, property } from '../core/PropertyNode.js';
import { tslFn } from '../shadernode/ShaderNode.js';
import { loop } from '../utils/LoopNode.js';
import { smoothstep } from '../math/MathNode.js';
import { smoothstep } from '../math/MathNode.js';
import { uniforms } from './UniformsNode.js';

class ClippingNode extends Node {
Expand Down Expand Up @@ -78,7 +78,7 @@ class ClippingNode extends Node {

plane = clippingPlanes.element( i );

distanceToPlane.assign( positionView.dot( plane.xyz ).negate().add( plane.w ) );
distanceToPlane.assign( positionView.dot( plane.xyz ).negate().add( plane.w ) );
distanceGradient.assign( distanceToPlane.fwidth().div( 2.0 ) );

unionClipOpacity.mulAssign( smoothstep( distanceGradient.negate(), distanceGradient, distanceToPlane ).oneMinus() );
Expand Down Expand Up @@ -126,6 +126,7 @@ class ClippingNode extends Node {
} );

clipped.discard();

}

} )();
Expand Down

0 comments on commit 31b2f94

Please sign in to comment.