File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -1326,12 +1326,18 @@ p5.Shader = class {
1326
1326
}
1327
1327
break ;
1328
1328
case gl . SAMPLER_2D :
1329
- gl . activeTexture ( gl . TEXTURE0 + uniform . samplerIndex ) ;
1330
- uniform . texture =
1331
- data instanceof p5 . Texture ? data : this . _renderer . getTexture ( data ) ;
1332
- gl . uniform1i ( location , uniform . samplerIndex ) ;
1333
- if ( uniform . texture . src . gifProperties ) {
1334
- uniform . texture . src . _animateGif ( this . _renderer . _pInst ) ;
1329
+ if ( typeof data == 'number' ) {
1330
+ gl . activeTexture ( gl . TEXTURE0 + data ) ;
1331
+ gl . uniform1i ( location , data ) ;
1332
+ }
1333
+ else {
1334
+ gl . activeTexture ( gl . TEXTURE0 + uniform . samplerIndex ) ;
1335
+ uniform . texture =
1336
+ data instanceof p5 . Texture ? data : this . _renderer . getTexture ( data ) ;
1337
+ gl . uniform1i ( location , uniform . samplerIndex ) ;
1338
+ if ( uniform . texture . src . gifProperties ) {
1339
+ uniform . texture . src . _animateGif ( this . _renderer . _pInst ) ;
1340
+ }
1335
1341
}
1336
1342
break ;
1337
1343
//@todo complete all types
You can’t perform that action at this time.
0 commit comments