I'm having some troubles with my textures but i'm not sure if its my GLSL shader, or my actual loading of the UV coordinates that is messed up. My model is UVW unwrapped in 3ds max and i've used that to texture it.
Just made a simple texture to test it out on this model.
This is the texture on the object in 3ds max.
And in my program...
The texture is quite messed up.
So i'm wondering if i've loaded the UV's incorrectly or my shader is wrong.
Vertex Shader:
#version 400
layout (location = 0) in vec3 VertexPosition;
layout (location = 1) in vec3 VertexNormal;
layout (location = 2) in vec2 TextureCoordinate;
out vec2 TexCoord;
uniform mat4 MVP;
void main()
{
TexCoord = TextureCoordinate;
gl_Position = MVP * vec4(VertexPosition,1.0);
}
Frag Shader:
#version 400
in vec2 TexCoord;
layout( location = 0 ) out vec4 FragColor;
uniform sampler2D myTextureSampler;
void main()
{
FragColor = texture(myTextureSampler, TexCoord);
}
Thank you.