Jump to content
  • Advertisement
Sign in to follow this  
Halogenic

Texture coordinates not being set on Vertex Shader using VBOs

This topic is 2529 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:

Initialisation: http://pastebin.com/0zNPNzCU
Drawing: http://pastebin.com/0bvRiUbE
Vertex Shader: http://pastebin.com/UkNvCbMC
Fragment Shader: http://pastebin.com/L34V3syb

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.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!