hi,
i need help on glsl. im trying to get each vertex on vertex shader and give the spherical value to fragment shader.
what i want to do is:
- get the light position
- get the vertex position
- calculate the direction from vertex to light, and normalize, resulting cartesian coordinate vec3
- find the spherical value from the cartesian coordinate. notice the r in spherical coordinate is set to 1 since its normalize.
- find the index, this step does not really matter since its my program logic.
here is the code:
http://pastebin.com/MNXN6EZg
nothing appear on the screen. did i do anything wrong? thanks.