No spot of light on cube

后端 未结 1 1575
醉话见心
醉话见心 2020-12-21 07:35

I have made three sources of light and one cube

I don\'t see a spot of light on faces. It\'s look like entire polygon is lit. And i don\'t know is this posible and

相关标签:
1条回答
  • Remember that the fixed-function lighting equation is only evaluated at the vertices of a triangle and interpolated across the fragment. No per-pixel lighting unless you get creative with GL_DOT3_RGB textures.

    Therefore if you want to see a nice spotlight highlight on your cube you'll need to subdivide your cube faces so that they're closer to pixel-sized:

    EDIT: Also remember to pass in reasonable per-vertex normals. Lighting doesn't work too well without them :)

    0 讨论(0)
提交回复
热议问题