Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Shader problem gl_TexCoord[0].xy giving wrong values  (Read 3164 times)

0 Members and 2 Guests are viewing this topic.

foxcode

  • Newbie
  • *
  • Posts: 4
    • View Profile
Shader problem gl_TexCoord[0].xy giving wrong values
« on: February 26, 2014, 10:50:42 pm »
Hello everyone, I have already posted about this on gamedev.net but am yet to find a solution.

I am creating a simple rectangle using a vertex buffer that is being draw to the screen. I am also creating a texture, loading the image from file, and passing it into a shader. I am using the default vertex and fragment shaders from the tutorials.

My problem is the fragment shader seems to be filling the entire rectangle with whatever colour the bottom right pixel of the texture happens to be. Has anyone come across this before?

Thanks

foxcode

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Shader problem gl_TexCoord[0].xy giving wrong values
« Reply #1 on: February 26, 2014, 11:10:22 pm »
Problem solved, texture co-ordinates were not normalized, thank you gamedev.net
http://www.gamedev.net/topic/653865-glsl/