![]() I figured out the problem, when I rendered the text to the screen (the text that describes the problem with the cube), I forgot to set the glBlendFunc() back to this setting, glBlendFunc(GL_ONE, GL_ZERO) ![]() Leave a comment if you need anything else to help solve this. I have to put the modelMatrix buffer into a buffer called preBuffer, if I don't I get errors for some reason. The normal3f variable stores the transposed inverse of the model matrix (which I am pretty sure is the correct way to calculate the normal Matrix). The modelMatrix variable is self explanitory, minus the fact that it is a buffer, not a matrix. GlUniformMatrix3(glGetUniformLocation(ss.pId, "normalMatrix"), false, nmBuffer) FloatBuffer preBuffer = BufferUtils.createFloatBuffer(16) The uniform variable normalMatrix is calculated like this. The lDir uniform variable stores a float array of. ![]() Gl_Position = projection * view * model * in_Position Vec3 normal = normalize(in_Normal * nMat) Here is my vertex shader code (My fragment shader just applies the color, all the work is done in the vertex shader). When I render a vbo cube using a directional light shader, the light appears "inside out".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |