![]() ![]() ![]() Possible error codes for glGetUniformLocation are: GL_INVALID_VALUE Thanks for the help folks.Įrror number ÃÂ♁282` is not very descriptive. These are the values for ambientProd at the time that line is executed. ![]() For clarity I am explicitly using this line instead glUniform4f( ambientHandle, ambientProd.x, ambientProd.y, ambientProd.z, ambientProd.w ) ![]() For testing I am commenting out the lines below the ones for ambientProduct. I have checked program->getHandle is a valid program If( dot(L, N) getHandle() is pointing to something that looks valid. discard the specular highlight if the light's behind the vertex Uniform vec4 ambientProduct, diffuseProduct, specularProduct įloat Ks = pow(max(dot(N, H), 0.0), shininess) output values that will be interpretated per-fragmentįragment.glsl // per-fragment interpolated values from the vertex shader GlUniform1f( shinyHandle, materialShininess ) GLuint shinyHandle = glGetUniformLocation(program->getHandle(), "shininess") GlUniform4fv( lightPosHandle, 1, light.position ) GLuint lightPosHandle = glGetUniformLocation(program->getHandle(), "lightPosition") GlUniform4fv( specularHandle, 1, specularProduct ) GLuint specularHandle = glGetUniformLocation(program->getHandle(), "specularProduct") GlUniform4fv( diffuseHandle, 1, diffuseProduct ) GLuint diffuseHandle = glGetUniformLocation(program->getHandle(), "diffuseProduct") GlUniform4fv( ambientHandle, 1, ambientProduct ) After setting up my uniforms I get a 1282 error from glGetError() for this piece of code GLuint ambientHandle = glGetUniformLocation(program->getHandle(), "ambientProduct") I am trying to add lighting to my current scene of a simple cube. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |