Skip to content

Commit b52aff8

Browse files
authored
ClippingNode: Move uniforms into render group. (#31716)
1 parent 3e184cd commit b52aff8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/nodes/accessors/ClippingNode.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Loop } from '../utils/LoopNode.js';
77
import { smoothstep } from '../math/MathNode.js';
88
import { uniformArray } from './UniformArrayNode.js';
99
import { builtin } from './BuiltinNode.js';
10+
import { renderGroup } from '../core/UniformGroupNode.js';
1011

1112
/**
1213
* This node is used in {@link NodeMaterial} to setup the clipping
@@ -94,7 +95,7 @@ class ClippingNode extends Node {
9495

9596
if ( this.hardwareClipping === false && numUnionPlanes > 0 ) {
9697

97-
const clippingPlanes = uniformArray( unionPlanes );
98+
const clippingPlanes = uniformArray( unionPlanes ).setGroup( renderGroup );
9899

99100
Loop( numUnionPlanes, ( { i } ) => {
100101

@@ -113,7 +114,7 @@ class ClippingNode extends Node {
113114

114115
if ( numIntersectionPlanes > 0 ) {
115116

116-
const clippingPlanes = uniformArray( intersectionPlanes );
117+
const clippingPlanes = uniformArray( intersectionPlanes ).setGroup( renderGroup );
117118
const intersectionClipOpacity = float( 1 ).toVar( 'intersectionClipOpacity' );
118119

119120
Loop( numIntersectionPlanes, ( { i } ) => {
@@ -154,7 +155,7 @@ class ClippingNode extends Node {
154155

155156
if ( this.hardwareClipping === false && numUnionPlanes > 0 ) {
156157

157-
const clippingPlanes = uniformArray( unionPlanes );
158+
const clippingPlanes = uniformArray( unionPlanes ).setGroup( renderGroup );
158159

159160
Loop( numUnionPlanes, ( { i } ) => {
160161

@@ -169,7 +170,7 @@ class ClippingNode extends Node {
169170

170171
if ( numIntersectionPlanes > 0 ) {
171172

172-
const clippingPlanes = uniformArray( intersectionPlanes );
173+
const clippingPlanes = uniformArray( intersectionPlanes ).setGroup( renderGroup );
173174
const clipped = bool( true ).toVar( 'clipped' );
174175

175176
Loop( numIntersectionPlanes, ( { i } ) => {
@@ -202,7 +203,7 @@ class ClippingNode extends Node {
202203

203204
return Fn( () => {
204205

205-
const clippingPlanes = uniformArray( unionPlanes );
206+
const clippingPlanes = uniformArray( unionPlanes ).setGroup( renderGroup );
206207
const hw_clip_distances = builtin( builder.getClipDistance() );
207208

208209
Loop( numUnionPlanes, ( { i } ) => {

0 commit comments

Comments
 (0)