Skip to content

Commit c22f378

Browse files
committed
Fixed issue when initializing pixishader from filter manager
1 parent 840ea05 commit c22f378

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

src/pixi/renderers/webgl/shaders/PixiShader.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ PIXI.PixiShader = function(gl)
7373
PIXI.PixiShader.prototype.constructor = PIXI.PixiShader;
7474

7575
PIXI.PixiShader.prototype.initMultitexShader = function () {
76-
if (this.fragmentSrc != null) {
77-
// Can't run multi-texture batching with filters
78-
this.initDefaultShader();
79-
return;
80-
}
8176
var gl = this.gl;
8277
this.MAX_TEXTURES = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
8378
var dynamicIfs = '\tif (vTextureIndex == 0.0) gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;\n'
@@ -225,9 +220,9 @@ PIXI.PixiShader.prototype.initDefaultShader = function () {
225220
*
226221
* @method init
227222
*/
228-
PIXI.PixiShader.prototype.init = function()
223+
PIXI.PixiShader.prototype.init = function(usingFilter)
229224
{
230-
if (PIXI._enableMultiTextureToggle) {
225+
if (PIXI._enableMultiTextureToggle && !usingFilter) {
231226
this.initMultitexShader();
232227
} else {
233228
this.initDefaultShader();

src/pixi/renderers/webgl/utils/FilterTexture.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ function _CreateFramebuffer(gl, width, height, scaleMode, textureUnit) {
3636
if(fbStatus !== gl.FRAMEBUFFER_COMPLETE) {
3737
console.error('Incomplete GL framebuffer. ', _fbErrors[fbStatus]);
3838
}
39-
// gl.bindTexture(gl.TEXTURE_2D, null);
40-
// gl.bindRenderbuffer(gl.RENDERBUFFER, null);
41-
// gl.bindFramebuffer(gl.FRAMEBUFFER, null);
42-
4339
framebuffer.width = width;
4440
framebuffer.height = height;
4541
framebuffer.targetTexture = colorBuffer;

src/pixi/renderers/webgl/utils/WebGLFilterManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea,
354354

355355
shader.fragmentSrc = filter.fragmentSrc;
356356
shader.uniforms = filter.uniforms;
357-
shader.init();
357+
shader.init(true);
358358

359359
filter.shaders[gl.id] = shader;
360360
}

0 commit comments

Comments
 (0)