I would know if there are two different way to read face normals of a “smoothed” model and a “solid” model…
I can read normals… but when I switch model between these two options I read always the same normals values…
Why? What’s wrong?
Not knowing the way that Blender performs smoothing means I can’t be sure, but I’ve a feeling that normals are interpolated or smoothed between vertices, meaning that if the normals are read from vertices they won’t change. If they’re read from faces then I guess they wouldn’t change either. Where they would change I believe, is the part of each polygon between it’s center and it’s edges.(edges would also change, but I’d expect the vertex and face normals would remain the same)
enhzflep is right. Blender uses OpenGL for display. If you set your model to “solid”, OpenGL does not interpolate normals - it just uses the face normal for rendering a whole face. When setting the model to “smooth”, normals are interpolated by OpenGL automatically. As far as i can remember, this time the vertex normals are used. For rendering fragments inside a face, OpenGL interpolates between the vertex normals of the face.
Therefore it makes no difference for you - there are two “types” of normals: face normal and vertex normal. Both of them don’t change when you switch your model between “solid” and “smooth”. It’s just a matter of which normals are feeded into OpenGL and if you tell OpenGL to do interpolation or not. The rest happens automatically during rasterization.
So - if nou need an interpolated normal at a location inside a face, i guess you have to do the interpolation yourself (maybe the OpenGL docs say something about how this happens internally, then you can code it the same way) - or look at the OpenGL docs to see if there’s a way of letting OpenGL do the job for you and read back the value.
Thanks very much to both!
Yes… in fact normals don’t change whether I read them from face or from vertex…
mm… I will try to find something on the OpenGL docs…