Archived

This topic is now archived and is closed to further replies.

Shyft777

Easy Light Question

Recommended Posts

Shyft777    122
I''m somewhat confused about creating different kinds of lights. I understand the code involved, but I don''t know how to specify the light type (Point, Spot, etc.) Lights seem to default to point lights, but will it automatically become a spot light if I set GL_SPOT_DIRECTION? Also, DX has an option for Directional lights. Is there any such thing in GL? Thanks

Share this post


Link to post
Share on other sites
Myopic Rhino    2317
When you set a light''s position, the fourth parameter controls whether or not it is a directional (0.0) or point (otherwise) light. To create a spotlight, you just have to set GL_SPOT_CUTOFF (which is a per-light setting) to a value between 0 and 90. By default (or if you set GL_SPOT_CUTOFF to 180), spotlighting is disabled.

Share this post


Link to post
Share on other sites