@@ -73,6 +73,11 @@ PIXI.PixiShader = function(gl)
7373PIXI . PixiShader . prototype . constructor = PIXI . PixiShader ;
7474
7575PIXI . PixiShader . prototype . initMultitexShader = function ( ) {
76+ if ( this . fragmentSrc != null ) {
77+ // Can't run multi-texture batching with filters
78+ PIXI . _enableMultiTextureToggle = false ;
79+ this . initDefaultShader ( ) ;
80+ }
7681 var gl = this . gl ;
7782 this . MAX_TEXTURES = gl . getParameter ( gl . MAX_TEXTURE_IMAGE_UNITS ) ;
7883 var dynamicIfs = '\tif (vTextureIndex == 0.0) gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;\n'
@@ -156,16 +161,19 @@ PIXI.PixiShader.prototype.initMultitexShader = function () {
156161} ;
157162
158163PIXI . PixiShader . prototype . initDefaultShader = function ( ) {
159- this . fragmentSrc = [
160- 'precision lowp float;' ,
161- 'varying vec2 vTextureCoord;' ,
162- 'varying vec4 vColor;' ,
163- 'varying float vTextureIndex;' ,
164- 'uniform sampler2D uSampler;' ,
165- 'void main(void) {' ,
166- ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;' ,
167- '}'
168- ] ;
164+
165+ if ( this . fragmentSrc === null ) {
166+ this . fragmentSrc = [
167+ 'precision lowp float;' ,
168+ 'varying vec2 vTextureCoord;' ,
169+ 'varying vec4 vColor;' ,
170+ 'varying float vTextureIndex;' ,
171+ 'uniform sampler2D uSampler;' ,
172+ 'void main(void) {' ,
173+ ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;' ,
174+ '}'
175+ ] ;
176+ }
169177
170178 var gl = this . gl ;
171179
@@ -391,7 +399,6 @@ PIXI.PixiShader.prototype.syncUniforms = function()
391399 for ( var key in this . uniforms )
392400 {
393401 uniform = this . uniforms [ key ] ;
394-
395402 if ( uniform . glValueLength === 1 )
396403 {
397404 if ( uniform . glMatrix === true )
0 commit comments