What is a normal in OpenGL?

前端 未结 3 1445
小蘑菇
小蘑菇 2021-02-05 08:36

I heard that I should use normals instead of colors, because colors are deprecated. (Is that true?) Normals have something to do with the reflection of light, but I can\'t find

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 08:44

    A normal in general is a unit vector whose direction is perpendicular to a surface at a specific point. Therefore it tells you in which direction a surface is facing. The main use case for normals are lighting calculations, where you have to determine the angle (or practically often its cosine) between the normal at a given surface point and the direction towards a lightsource or a camera.

提交回复
热议问题