File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 3232 this . _textureAtlas = null ;
3333 this . _colorUnmodified = cc . color . WHITE ;
3434 this . _colorF32Array = null ;
35+ this . _uniformColor = null ;
3536
3637 this . _matrix = new cc . math . Matrix4 ( ) ;
3738 this . _matrix . identity ( ) ;
3839
3940 //shader stuff
4041 this . _shaderProgram = cc . shaderCache . programForKey ( cc . SHADER_POSITION_TEXTURE_UCOLOR ) ;
42+ this . _uniformColor = cc . _renderContext . getUniformLocation ( this . _shaderProgram . getProgram ( ) , "u_color" ) ;
4143 } ;
4244
4345 var proto = cc . AtlasNode . WebGLRenderCmd . prototype = Object . create ( cc . Node . WebGLRenderCmd . prototype ) ;
6971 this . _glProgramState . apply ( this . _matrix ) ;
7072
7173 cc . glBlendFunc ( node . _blendFunc . src , node . _blendFunc . dst ) ;
72- if ( this . _colorF32Array ) {
73- this . _glProgramState . setUniformVec4v ( "u_color" , this . _colorF32Array ) ;
74+ if ( this . _uniformColor && this . _colorF32Array ) {
75+ context . uniform4fv ( this . _uniformColor , this . _colorF32Array ) ;
7476 this . _textureAtlas . drawNumberOfQuads ( node . quadsToDraw , 0 ) ;
7577 }
7678 } ;
Original file line number Diff line number Diff line change @@ -340,6 +340,7 @@ cc._tmp.WebGLTexture2D = function () {
340340 width + point . x , height + point . y , 0.0 ] ;
341341
342342 self . _glProgramState . apply ( ) ;
343+ self . _glProgramState . _glprogram . setUniformsForBuiltins ( ) ;
343344
344345 cc . glBindTexture2D ( self ) ;
345346
@@ -369,6 +370,7 @@ cc._tmp.WebGLTexture2D = function () {
369370 rect . x + rect . width , rect . y + rect . height /*0.0*/ ] ;
370371
371372 self . _glProgramState . apply ( ) ;
373+ self . _glProgramState . _glprogram . setUniformsForBuiltins ( ) ;
372374
373375 cc . glBindTexture2D ( self ) ;
374376
You can’t perform that action at this time.
0 commit comments