Hi, need openGl's lighting code

Hi, I’m looking for openGL’s lighting code.
If anyone can tell me how can I access the openGL source code it would be great.


OpenGL is an open standard, not open source.

Mesa3D is an open source implementation of OpenGL, check it.

Maybe you mean you need the lighting equations used in the fixed-pipeline. In this case, look at the spec 3.2 with compatibility profile, page 74 and 75:


Or, if the red font hurts your eyes, then just get the spec 2.1, pages 62 and 63:

The OpenGL Red Book is a really easy read, and in English. There’s a whole chapter on Lighting. Once you’ve got the concepts and basic lighting algorithms in-mind, following lighting code in various GLSL lighting tutorials (google it) and Mesa3D code should be a lot simpler.

Also, 3DLabs’ ShaderGen tool will generate GLSL shaders for specific fixed-function pipeline permutations, including lighting. Might accelerate your task a bit.