Jump to content
  • Advertisement


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


AboUt how to calculate LIGHT ?

This topic is 5310 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
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.

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

Sign me up!