I'm currently writing a game using OpenGL and GLSL. For the shader I need the direction from the current camera to the light source. The lightsource is given by
lightSource.position as a uniform as well as the ModelviewMatrix (mat4).
The task is
TODO: compute the vectors from the current vertex towards the camera and towards the light source
I need to fill two varyings with those information, but I'm not sure how to compute them. In addition I've the following information:
#version 330 layout(location = 0) in vec3 vertex; layout(location = 1) in vec3 vertex_normal;