We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 433965a commit 90fc8d8Copy full SHA for 90fc8d8
src/passes/GeometryPass.ts
@@ -379,11 +379,18 @@ export class GeometryPass extends Pass implements Selective {
379
}
380
381
this.registeredMaterials.add(material);
382
- const onBeforeCompile = material.onBeforeCompile.bind(this);
+
383
+ /* eslint-disable @typescript-eslint/unbound-method */
384
+ const onBeforeCompile = material.onBeforeCompile;
385
386
material.onBeforeCompile = (shader: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer) => {
387
- onBeforeCompile(shader, renderer);
388
+ // Workaround for troika-three-text, see #660.
389
+ if(material.onBeforeCompile !== onBeforeCompile) {
390
391
+ onBeforeCompile.call(material, shader, renderer);
392
393
+ }
394
395
if(this.gBuffer === null) {
396
0 commit comments