Page 2 of 2

Re: Texture Y flipped with OpenGL.

Posted: Tue Mar 08, 2016 11:03 pm
by Nadro
I just checked a shader code once more and I don't see a line like that:

Code: Select all

gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
but:

Code: Select all

gl_TexCoord[0] = gl_MultiTexCoord0;
In this way auto-flipping can't work in v1.8 too...

You must multiply "gl_TextureMatrix[yourTexUnit]" and texcoord if you use shaders and you want to use auto-flipping feature in v1.8. In trunk "gl_TextureMatrix[yourTexUnit]" isn't active (no overhead due to that), you must pass texture matrix via uniform yourself, it's the only difference.

Why it works like that? If you use vertex shader you have a full control over vertex transformation (no auto transformation by fixed pipeline at this step).

I tested posted sample with both v1.8.3 (up-to date from SVN) and the latest trunk and it looks the same in both cases. Why it "works" on your platform in v1.8? IIRC you have Nvidia card. NV drivers allow developers to do a strange things with OpenGL :P I think that mul by gl_TextureMatrix[0] may be done under the hood by NV drivers, but it's not allowed by OGL specification...

Re: Texture Y flipped with OpenGL.

Posted: Wed Mar 09, 2016 8:53 am
by devsh
A) Texture Matrices are not GL core, so they should be removed (if someone wants matrices for their TC, have them as custom user data)
B) Texture Y is flipped in OpenGL natively, and it always has been (texture top is origin)
C) you write custom materials/shaders for GL anyway, so....
D) If you're really not okay with this, then make a texture upload flag which flips the texture lines when uploading them to OpenGL

Re: [no bug] Texture Y flipped with OpenGL.

Posted: Thu Mar 10, 2016 12:34 am
by Mel
Vulkan also uses DX like texture space, with the Y axis inverted with regard to GL. GL chose that to be coherent to their space orientation, but many people just gets confused with it.