Skip to main content
GameDev.net gamedev.net
🔒 Locked

GLSL Matrices

Started by texel3d Apr 21, 2009 at 5:28 AM 0 replies 1.4k views
Original Post
texel3d
texel3d
hi, i try to use my own matrix in GLSL, instead of OpenGL Matrix. I have a created C++ functions which create the same matrices as OpenGL. When i use glGetFloatv( GL_MODELVIEW_MATRIX, fvMatrix ) my matrix is exactely the same as fvMatrix in the Visual C++ debugger. The same thing with glGetFloatv( GL_PROJECTION_MATRIX, fvMatrix ). But when i sent my matrices to the shader, it deosn't render properly. mat4 matWorldViewProj = gl_ProjectionMatrix * gl_ModelViewMatrix; // Works mat4 matWorldViewProj = g_myMatrixProjection * g_myMatrixModelView; // does not Works Are the Projection and ModelView matrices from OpenGL (C++) modified before to be available in the GLSL shader ? When i sent to the shader the matrices i get from glGetFloatv. I have the same problem. Thanks.
texel3d
texel3d
Ok it works now.
I have to use "false" in glUniformMatrix4fv.
It didn't work before for other reasons.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.