lid6j86's picture

Understanding Shaders

So based on what I'm reading, pretty much all of the functionality OpenTK provides for projection matricies is depreciated because we are suppossed to build our own, correct?

If that's the case, then in shaders I should not be using gl_ModelViewProjectionMatrix? What would I do, then? Create my own 4x4 matrix and push it to the shader as a uniform variable, then multiply each vertex by that?

I'm a little confused because I don't fully understand what about it is depreciated and what is not.

for instance, do I still create my projection matrix by calling matrixmode(projection) and setting up a ortho or perspective matrix?

Also, if I'm creating my own matrix and sending it into the shader, in the render loop I would still say LoadMatrix(myCustomMatrix) for all of that stuff, or would I somehow handle all of that in the shader? I understand the basics of what the vertex shader and fragment shader are for, but I'm confused on where I should be manipulating all of the matricies: in the render loop or in the shader.

I hope that made sense. My head is tied into a pretzel right now