Thank you again, now i am coming back to my initial post, just for clarification:
I see the warnings without mentioning a u_color anywhere in my code.
to reproduce:
create a JS project:
cocos new uniformwarningstest -p com.ati.uniformwarningstest -l js -d .
modify the Layer:
var HelloWorldLayer = cc.Layer.extend({
sprite:null,
ctor:function () {
this._super();
this._layer3D = new cc.Layer();
this.addChild(this._layer3D, 2);
this._model = new jsb.Sprite3D(res.model);
this._uvmap = cc.textureCache.addImage(res.HelloWorld_png);
this._model.setTexture(this._uvmap);
this._layer3D.addChild(this._model);
this._model.setRotation3D(cc.math.vec3(0, 0, 0));
this._model.setPosition3D(cc.math.vec3(0, 0, 0));
this._model.setScale(15.0);
var shader = new cc.GLProgram(res.sh_vert, res.sh_frag);
var state = cc.GLProgramState.create(shader);
this._model.setGLProgramState(state);
this._camera = new cc.Camera(cc.Camera.Mode.PERSPECTIVE, 75, cc.winSize.width / cc.winSize.height, .1, 200);
this._camera.setCameraFlag(2);
this._layer3D.addChild(this._camera);
this._layer3D.setCameraMask(2);
this._camera.setPosition3D(cc.math.vec3(0, 0, 30));
this._camera.lookAt(cc.math.vec3(0, 0, 0));
return true;
}});
with those minimalistic shaders:
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec3 a_normal;
attribute vec2 a_texCoord1;
void main(void) {
gl_Position = CC_MVPMatrix * a_position;
}
and frag:
void main (void)
{
gl_FragColor = vec4(0.3,0.3,0.3,0.6);
}
run this, in osx, android or ios, and see console dumping out this line over and over:
cocos2d: warning: Uniform not found: u_color
no “u_color” mentioned anywhere.
but i can see my model. can it be a problem with the material of in the c3b?
any help out there, please?
thanks. steff