Advertisement Jump to content
Sign in to follow this  

Texture coordinates not being set on Vertex Shader using VBOs

This topic is 2599 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

I'm having a problem with texture coordinates not being set on my shader program using a VBO to store the vertex positions and texture coordinates.

I've confirmed that it's the setting of the texture coords that isn't correct because my poly's vertices are rendered correctly and the whole surface is given a single colour. In fact this colour is taken from the texture I want it to use.

The texture coordinate seems to only be set to (0.0, 0.0) for each vertex and therefore only samples from the bottom-left of my texture. I've confirmed I'm passing through variables correctly from the Vertex Shader to the Fragment Shader as I can set a single block colour to be output from the Fragment Shader.

Here's the code for the relevant parts:

Vertex Shader:
Fragment Shader:

I've searched for a solution to this problem for a couple of days now with no luck. Any help you can give would be much appreciated.


Share this post

Link to post
Share on other sites
Output from the vertex shader and input to the fragment shader are linked by their names. Your texture coordinate output from the vertex shader is named texCoordOut, but the input to the fragment shader is names texCoord; the two are thus not linked together.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!