@@ -112,7 +112,7 @@ export class GeometryPass extends Pass implements GeometryPassOptions, Selective
112112 * A collection of materials that have been modified with `onBeforeCompile`.
113113 */
114114
115- private readonly registeredMaterials : WeakSet < Material > ;
115+ private static readonly registeredMaterials = new WeakSet < Material > ( ) ;
116116
117117 /**
118118 * A pass that copies the default input buffer to the output color buffer.
@@ -180,7 +180,6 @@ export class GeometryPass extends Pass implements GeometryPassOptions, Selective
180180 this . selection = new Selection ( ) ;
181181 this . selection . enabled = false ;
182182 this . gBufferConfig = gBufferConfig ;
183- this . registeredMaterials = new WeakSet < Material > ( ) ;
184183 this . copyPass = new CopyPass ( ) ;
185184 this . copyPass . enabled = false ;
186185 this . subpasses = [ this . copyPass ] ;
@@ -345,13 +344,13 @@ export class GeometryPass extends Pass implements GeometryPassOptions, Selective
345344
346345 for ( const material of materials ) {
347346
348- if ( this . registeredMaterials . has ( material ) ) {
347+ if ( GeometryPass . registeredMaterials . has ( material ) ) {
349348
350349 return ;
351350
352351 }
353352
354- this . registeredMaterials . add ( material ) ;
353+ GeometryPass . registeredMaterials . add ( material ) ;
355354
356355 /* eslint-disable @typescript-eslint/unbound-method */
357356 const onBeforeCompile = material . onBeforeCompile ;
0 commit comments