Skip to content

Commit e67830f

Browse files
committed
wip fixing pixi's filter manager bug with multi-texture implementation
1 parent b7a6120 commit e67830f

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ 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);
39+
// gl.bindTexture(gl.TEXTURE_2D, null);
40+
// gl.bindRenderbuffer(gl.RENDERBUFFER, null);
41+
// gl.bindFramebuffer(gl.FRAMEBUFFER, null);
4242

4343
framebuffer.width = width;
4444
framebuffer.height = height;
@@ -57,11 +57,27 @@ function _CreateFramebuffer(gl, width, height, scaleMode, textureUnit) {
5757
*/
5858
PIXI.FilterTexture = function(gl, width, height, scaleMode, textureUnit)
5959
{
60+
textureUnit = typeof textureUnit === 'number' ? textureUnit : 0;
6061
/**
6162
* @property gl
6263
* @type WebGLContext
6364
*/
6465
this.gl = gl;
66+
var glUniform1f = gl.uniform1f.bind(gl);
67+
var glGetUniformLocation = gl.getUniformLocation.bind(gl);
68+
gl.uniform1f = function (location, value) {
69+
//console.log('uniform1f', location, value);
70+
glUniform1f(location, value);
71+
// debugger;
72+
};
73+
gl.getUniformLocation = function (program, name) {
74+
console.log('getUniformLocation', program, name);
75+
if (name === 'blur') {
76+
debugger;
77+
}
78+
return glGetUniformLocation(program, name);
79+
//debugger;
80+
};
6581

6682
// next time to create a frame buffer and texture
6783

0 commit comments

Comments
 (0)