Jump to content
  • Advertisement

Archived

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

Shyft777

Easy Light Question

This topic is 5404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!