Hello,

I've writting myself a graphical wrapper for writing API independant code, also including a basic unified shading language. For 90% of the times this works well without any kind of modification, but then there are times when I'm just having such trouble getting stuff to work under OpenGL4. My entry-point, if you will, is always DirectX11, because I'm far more common to it, and so are my coordinate systems (LH).

Now most of my problems are due to matrix multiplications. First thing I did was flip the multiplication order when parsing out GLSL shader code. I also flipped the sign of the m22-value in the projection-matrices to resolve a problem where everything was rendered upside down.

Matrix MatPerspFovLH(float fovy, float aspect, float zn, float zf) { float yScale = cotan(fovy/2.0f); float xScale = yScale / aspect; return Matrix( xScale, 0.0f, 0.0f, 0.0f, #ifdef ACL_API_GL4 0.0f, -yScale, 0.0f, 0.0f, #else 0.0f, yScale, 0.0f, 0.0f, #endif 0.0f, 0.0f, zf/(zf-zn), 1.0, 0.0f, 0.0f, -zn*zf/(zf-zn), 0.0f); }

However, this was a total quess (I'm still quite surprised it works), and there are still occasional problems, like right now I'm trying to solve a complete f***-up in my cascaded shadow maps in opengl.

The question now mainly is: Is there any way, like some sort of setting, to make matrix multiplication, screen space etc... compatible to DirectX in OpenGL (or vice versa, for all I care), without having to "manually" adjust multiplication order and tampering with the matrix values? I'm also hoping that those issues will go away once that works, so well...