@grimfate wrote:
I have a shader working that I can use to manipulate the colors of a sprite, but I am struggling to pass values to variables within the shader. Whenever I call
setUniformVec2
, I get the errorUniform not found
.I load the shader through
GLProgram* prog = GLProgram::createWithFilenames("res/shader.vsh", "res/shader.fsh");
I create the
GLProgramState
throughauto progState = GLProgramState::getOrCreateWithGLProgram(prog);
I set the program state with the sprite through
sprite->setGLProgramState(progState);
This works fine without trying to pass a variable. But when I call
progState->setUniformVec2("u_point", Vec2(0, 0));
I get theUniform not found
error.The vertex shader file contains
uniform vec2 u_point;
Is there something I have to do for cocos2d-x to register the uniform for setting it?
Thanks.
Posts: 13
Participants: 3