How to get the normal vector of a pixel which is used for lighting in OnenGL?

We know that the normal vector of a pixel is used for lighting in openGL and the normal vector of each pixel of the displayed model is known to openGL before lighting rendering, so is there any way we could get the normal vector after the model is rendered?

You can write it out to an extra bound texture buffer but you need to use shaders to do this

Thanks. You mean we can get the normal vector of each pixel before the model is rendered and could you please tell me more info on how to do this. Thanks again.

Are you familiar with shaders and glsl?

Sorry, I am not. But I googled glsl, it seems a higher level APIs than opengl.
What I am doing at the moment is using opengl rendering to do some simulation. I first draw and render a model with basic opengl functions, and then try to get the pixel information including z-buffer and normal vector for further simulation. Now z-buffer is easy to get with glReadPixel(), but as to the normal vector, hope you could kindly help. I think basic opengl APIs instead of glsl are profered. Do you agree with me that opengl knows the normal vector of each pixel for light indensity computing? If so, where does opengl store the data and how to extract?

The gpu can calculate the normal for each fragment ( pixel ) but you cannot get access to it without using shaders. The gpu does not need to store this information as it uses it immediately that it calculates it and has no need for it again so it does not store it. If you want to keep it you have to write it out yourself - hence the need to replace the default shader with your own. The shader language glsl is quite a large topic so you will need to do familiar with it before you can do what you want to do.

Now I’m clear. Thanks any way.
BTW, is glsl a replacement of opengl?

BTW, is glsl a replacement of opengl?

No, you might call it an extension. OpenGL was designed when the graphics card was only silicon and you could set switches to control the path though the hardwired logic but you could not change the basic hardware. Now it is a computer in is own right (or actually many computers) so you can write programs for it. The programming language for the graphics card that has been developed to work with OpenGL is glsl. Directx has a similar programming language call hlsl. Many mobile phones and tablets support a subset of this programming language and OpenGL called OpenGL ES

Thanks for the explanation.