1
Graphics / Re: Binding real position to shader
« on: June 01, 2013, 01:38:16 pm »
Ok, so after your post, I went back and cleaned up my code, passing only the exact position as I've passed it into the CircleShape.
This didn't work, but since I assumed you are correct (it is your code), so I went to check my other code - namely my shader code.
My problem was in the vertex shader.. I had accidentally written
So, problem fixed, thanks! It's still good to know that the exact world position as I pass it into shapes is what I need to pass in to the shaders.
This didn't work, but since I assumed you are correct (it is your code), so I went to check my other code - namely my shader code.
My problem was in the vertex shader.. I had accidentally written
Code: [Select]
fragPos = gl_Vertex * gl_ModelViewMatrix;
in my hurry to test this. The correct line is of course:Code: [Select]
fragPos = gl_ModelViewMatrix * gl_Vertex;
So, problem fixed, thanks! It's still good to know that the exact world position as I pass it into shapes is what I need to pass in to the shaders.