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 32
32
this . _textureAtlas = null ;
33
33
this . _colorUnmodified = cc . color . WHITE ;
34
34
this . _colorF32Array = null ;
35
+ this . _uniformColor = null ;
35
36
36
37
this . _matrix = new cc . math . Matrix4 ( ) ;
37
38
this . _matrix . identity ( ) ;
38
39
39
40
//shader stuff
40
41
this . _shaderProgram = cc . shaderCache . programForKey ( cc . SHADER_POSITION_TEXTURE_UCOLOR ) ;
42
+ this . _uniformColor = cc . _renderContext . getUniformLocation ( this . _shaderProgram . getProgram ( ) , "u_color" ) ;
41
43
} ;
42
44
43
45
var proto = cc . AtlasNode . WebGLRenderCmd . prototype = Object . create ( cc . Node . WebGLRenderCmd . prototype ) ;
69
71
this . _glProgramState . apply ( this . _matrix ) ;
70
72
71
73
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 ) ;
74
76
this . _textureAtlas . drawNumberOfQuads ( node . quadsToDraw , 0 ) ;
75
77
}
76
78
} ;
Original file line number Diff line number Diff line change @@ -340,6 +340,7 @@ cc._tmp.WebGLTexture2D = function () {
340
340
width + point . x , height + point . y , 0.0 ] ;
341
341
342
342
self . _glProgramState . apply ( ) ;
343
+ self . _glProgramState . _glprogram . setUniformsForBuiltins ( ) ;
343
344
344
345
cc . glBindTexture2D ( self ) ;
345
346
@@ -369,6 +370,7 @@ cc._tmp.WebGLTexture2D = function () {
369
370
rect . x + rect . width , rect . y + rect . height /*0.0*/ ] ;
370
371
371
372
self . _glProgramState . apply ( ) ;
373
+ self . _glProgramState . _glprogram . setUniformsForBuiltins ( ) ;
372
374
373
375
cc . glBindTexture2D ( self ) ;
374
376
You can’t perform that action at this time.
0 commit comments