I'm trying to map a texture on to a quad in DirectX 11 and OpenGL 4.5. From my understanding this how the texture mapping coordinates for OpenGL and DirectX should look like
However in my case both OpenGL and DirectX looks to be using OpenGL's way of mapping. I don't understand why is that happening.
This is my UV for both DirectX and OpenGL. The image looks perfect in both OpenGL and DirectX. This way of mapping should only work in OpenGL coordinates system and in DirectX the image should be upside down. However that is not the case.
//create vertices clockwise
//Top Left
tri1Vertices[0].position = Vector3(-1.0f, 1.0f, 0.0f);
tri1Vertices[0].UV = Vector2(0.0f, 1.0f);
//Top Right
tri1Vertices[1].position = Vector3(1.0f, 1.0f, 0.0f);
tri1Vertices[1].UV = Vector2(1.0f, 1.0f);
//Bottom Right
tri1Vertices[2].position = Vector3(1.0f, -1.0f, 0.0f);
tri1Vertices[2].UV = Vector2(1.0f, 0.0f);
//Bottom Left
tri1Vertices[3].position = Vector3(-1.0f, -1.0f, 0.0f);
tri1Vertices[3].UV = Vector2(0.0f, 0.0f);
unsigned int indices[6] { 0, 1, 2, 2, 3, 0 };
//Top Left
tri1Vertices[0].UV = Vector2(0.0f, 0.0f);
//Top Right
tri1Vertices[1].UV = Vector2(1.0f, 0.0f);
//Bottom Right
tri1Vertices[2].UV = Vector2(1.0f, 1.0f);
//Bottom Left
tri1Vertices[3].UV = Vector2(0.0f, 1.0f);