So I have been working on this engine for awhile and I have a whole 3D world now with a working camera, shader with textures and lighting. Now I am trying to do a GUI. I am disabling DEPTH_TEST, switching to orthographic view, and turning off the lightning, or trying. Now whenever I try to render these two “interfaces”, it always renders them as if the vertex color is the UV coordinates, even tho I am setting the vertex color to white. Now I am using the same shader as all my other stuff. Here are some photos:
With the frag color in the fragment shader set equal to the texture color:
frag_color = texture2D(sampler, vTexture.st);
[ATTACH=CONFIG]857[/ATTACH]
With the frag color equal to the vertex color:
frag_color = vColor;
[ATTACH=CONFIG]858[/ATTACH]
Here is the setup for the quad:
mesh->addVertex(Vertex(Vector3f(Position.getX() + half_width, Position.getY() + half_height, 0.0f), Vector3f(1.0f), Vector3f(0.0f, 0.0f, 1.0f), Vector2f(1.0f, 1.0f)));
mesh->addVertex(Vertex(Vector3f(Position.getX() - half_width, Position.getY() + half_height, 0.0f), Vector3f(1.0f), Vector3f(0.0f, 0.0f, 1.0f), Vector2f(0.0f, 1.0f)));
mesh->addVertex(Vertex(Vector3f(Position.getX() - half_width, Position.getY() - half_height, 0.0f), Vector3f(1.0f), Vector3f(0.0f, 0.0f, 1.0f), Vector2f(0.0f, 0.0f)));
mesh->addVertex(Vertex(Vector3f(Position.getX() + half_width, Position.getY() - half_height, 0.0f), Vector3f(1.0f), Vector3f(0.0f, 0.0f, 1.0f), Vector2f(1.0f, 0.0f)));
I don’t understand what could be wrong. Really stumped. I traced through all the initilizations but its all the same shader, mesh class, etc. It just with the 2D interface, it makes it the UV coords.