I need to ask if I’m right about how shaders read the built-in variables for example: gl_modelviewprojectionmatrix
If I use old style (deprecated) glrotation, gltranslate etc… I will modify accordingly the current matrix (viewmatix)
when after that I call gl_useprogram the actual built in variable viewmatrix (and those who use it like modelviewprojection) in the shaders will contain the modifed (by glrotate etc) view matrix right?
Am I wrong somewhere?
I ask because i know ‘fixed’ functions must be used separately from programmable (basically when you start using useprogram), and even if both are now deprecated they are useful for quick applications.
Not properly, I just wanted a confirm on what I said on first part:
If I use old style (deprecated) glrotation, gltranslate etc… I will modify accordingly the current matrix (viewmatix)
when after that I call gl_useprogram the actual built in variable viewmatrix (and those who use it like modelviewprojection) in the shaders will contain the modifed (by glrotate etc) view matrix right?
This will work as long as your GLSL version is below 1.30. For more recent versions, this does not exist anymore, and you’ll have to deal with your own matrices yourself, and on both sides (code and shader).