Code :dot( normalize( Light1Position - vec3(modelViewProjectionMatrix * position) ), normalize( normalMatrix * normal ) )
Light1Position is the location of the red dot and I'm translating the spheres using the modelview matrix. How can I make the lighting look correct? Also, I'd like the lighting intensity to decrease with distance.
Are there any solid tutorials online for this?