@@ -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*/
5858PIXI . 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