Hey,
I recently started studying OpenGL with the intention of adding an OpenGL 4.X rendering backend to my, currently DX11-only, engine. Before I started I want to get a better picture of what "DX is left-handed, OpenGL is right-handed" means in the modern APIs. To my understanding, modern OpenGL has done away with the LookAt() functions and similar functionality (that heavily depended on a certain handedness) in the same way as DX no longer has these things built in. I have built a very simple vector and matrix library that I use with DX11 and it assumes a left-handed coordinate system. I would like to use the same library with the OpenGL rendering backend. Where do I need to do any conversions? Does the modern OpenGL API still assume I am working with right-handed coordinates, or was that only in the old API?
Some things I do know (and correct me if I am wrong):
- My matrices are row-major and OpenGL wants them as column-major, so that's a transpose call.. (I am using the FX-framework for DX11 and I am going to get rid of that too. I actually think that DX11 wants them as column-major too but the FX-framework has done a transpose for me, so that might be one difference that will go away once I ditch the FX-framework?)
- The NDC z-axis goes from 0->1 in DX and -1->1 in OpenGL, so I have to take that into account, but that's just using a different projection matrix, right?
Anything else that needs to be done for this to work in OpenGL? For now, I am going to hand write all shaders as separate HLSL and GLSL versions, ie. no automatic translation or higher-level language. Is there something that needs to be reversed in the shader code with regards to the handedness of the coordinate space?
Cheers!