I started learning the use of OpenGl/OpenTK short time ago so please forgive my clumsiness.
I try to render basic shapes with a basic light effect (I have a sphere and I would like to see it lit on one side and dark on the other depending on the light, and be able to change the light direction and intensity).
I use a little GLSL code I found in a lightning tutorial and vertex/index buffers like in the OpenTK sample "simple GLSL", but I didn't manage to use a normals buffer (I tried to do the same operation as for the vertex buffer, only changing EnableCap.VertexArray to EnableCap.NormalArray but it didn't work).
I changed the GLSL code so that it gets the normal vectors from the vertex position but I don't get a satisfying result:
The light intensity on the sphere's pixels seems to be determined by the distance of this pixel from the center of the screen ... not natural at all.
I didn't find how to change the light direction, only the light intensity with:
GL.Light(LightName.Light0, LightParameter.Ambient or ConstantAttenuation);
If you could show me a sample code of the difficult points it would help me much.