No spot of light on cube
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 cube need more polygons or mayby light settings are bad. Settings i use.
glShadeModel(开发者_运维知识库GL_SMOOTH);
glLightf(GL_LIGHT2, GL_SPOT_CUTOFF, 150.0f);
glLightf(GL_LIGHT2, GL_SPOT_EXPONENT, 15.0f);
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 :)
精彩评论