Jump to content
  • Advertisement

Archived

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

Wickeeed

AboUt how to calculate LIGHT ?

This topic is 5485 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

hi to all, can somebody show me how to calculate nice Light ?? like real spot or sun ??? float LightPos[] = { 0.0f, 0.0f,-0.0f, 1.0f}; float LightDif[] = { 0.01f, 0.01f, 0.01f, 1.0f}; float LightAmb[] = { -(0.01f/0.03f), -(0.01f/0.03f); float LightSpc[] = { 1.02f, 1.02f, 1.02f, 1.0f};

Share this post


Link to post
Share on other sites
Advertisement
the last element in LightPos should be 0 if you want directional (like the sun) light

for making spot lights set the falloff and the angle of the spotlight. Remember to tesselate the surface that is lighted because GL uses vertex lights so the light may not look nice for a big quad.

ambient is the base amount of light for a vertex (the color if there is no light at all)

there are some tutorials about this. Google is your friend

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!