I put back exactly the shaders you posted after i managed to get main program better. Deforming and some problems were due to not passing right uniforms. I can see the pixel-shaded model (with no specular at all), but with light direction problems i had in my own version before. Not sure the code is right, but this is what i'm doing in loop:
Code:
glGetFloatv(GL_PROJECTION_MATRIX, @p4);
glLoadIdentity;
glTranslatef(0, 0, -2.2);
glMultMatrixf(@mat);
glGetFloatv(GL_MODELVIEW_MATRIX, @m4);
m4:=m4*p4;
if locWVP>0 then glUniformMatrix4fv(locWVP, 1, bytebool(GL_FALSE), @m4);
if locW>0 then glUniformMatrix4fv(locW, 1, bytebool(GL_FALSE), @mat);
campos:=vector(0, 0, 2.2);
if locCam>0 then glUniform3fv(locCam, 1, @campos);
//glMultMatrixf(@mat); // I think this must be called before getting model_view
model.Render; // (Model diameter is 0.5)
Bookmarks