@@ -524,11 +524,11 @@ function material(p5, fn) {
524524 // Test if we've loaded GLSL or not by checking for the existence of `void main`
525525 let loadedShader ;
526526 if ( / v o i d \s + m a i n / . exec ( fragString ) ) {
527- loadedShader = this . createFilterShader ( fragString , true ) ;
527+ loadedShader = this . _internal ( ( ) => this . createFilterShader ( fragString , true ) ) ;
528528 } else {
529- loadedShader = withGlobalStrands ( this , ( ) =>
529+ loadedShader = this . _internal ( ( ) => withGlobalStrands ( this , ( ) =>
530530 this . baseFilterShader ( ) . modify ( new Function ( fragString ) ) ,
531- ) ;
531+ ) ) ;
532532 }
533533
534534 if ( successCallback ) {
@@ -1597,7 +1597,7 @@ function material(p5, fn) {
15971597 fn . loadMaterialShader = async function ( url , onSuccess , onFail ) {
15981598 try {
15991599 const cb = await urlToStrandsCallback ( url ) ;
1600- let shader = withGlobalStrands ( this , ( ) => this . buildMaterialShader ( cb ) ) ;
1600+ let shader = this . _internal ( ( ) => withGlobalStrands ( this , ( ) => this . buildMaterialShader ( cb ) ) ) ;
16011601 if ( onSuccess ) {
16021602 shader = onSuccess ( shader ) || shader ;
16031603 }
@@ -1814,9 +1814,9 @@ function material(p5, fn) {
18141814 fn . loadNormalShader = async function ( url , onSuccess , onFail ) {
18151815 try {
18161816 const cb = await urlToStrandsCallback ( url ) ;
1817- let shader = this . withGlobalStrands ( this , ( ) =>
1817+ let shader = this . _internal ( ( ) => this . withGlobalStrands ( this , ( ) =>
18181818 this . buildNormalShader ( cb ) ,
1819- ) ;
1819+ ) ) ;
18201820 if ( onSuccess ) {
18211821 shader = onSuccess ( shader ) || shader ;
18221822 }
@@ -1978,7 +1978,7 @@ function material(p5, fn) {
19781978 fn . loadColorShader = async function ( url , onSuccess , onFail ) {
19791979 try {
19801980 const cb = await urlToStrandsCallback ( url ) ;
1981- let shader = withGlobalStrands ( this , ( ) => this . buildColorShader ( cb ) ) ;
1981+ let shader = this . _internal ( ( ) => withGlobalStrands ( this , ( ) => this . buildColorShader ( cb ) ) ) ;
19821982 if ( onSuccess ) {
19831983 shader = onSuccess ( shader ) || shader ;
19841984 }
@@ -2237,7 +2237,7 @@ function material(p5, fn) {
22372237 fn . loadStrokeShader = async function ( url , onSuccess , onFail ) {
22382238 try {
22392239 const cb = await urlToStrandsCallback ( url ) ;
2240- let shader = withGlobalStrands ( this , ( ) => this . buildStrokeShader ( cb ) ) ;
2240+ let shader = this . _internal ( ( ) => withGlobalStrands ( this , ( ) => this . buildStrokeShader ( cb ) ) ) ;
22412241 if ( onSuccess ) {
22422242 shader = onSuccess ( shader ) || shader ;
22432243 }
0 commit comments