Jump to content
  • Advertisement
Sign in to follow this  

indirect lighting for terrain

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

well im not rly into indirect lighting... havent rly looked into it but ive got a few ideas... just posting it here for confirmation... in the first pass i have each point illuminted by a lightsource using the dotproduct of the points normal and the lightnormal... in the second pass i take a point and use the dotvector between the point and each surrounding point withing a certain distance and in the horizon of the points ... multipliying this with the other points brightness and dividing it by the distance times a constant... it would look somethig like this...
Point = P
PointNormal = PN
Surrounding point = SP
Surrounding point normal = SPN

for each P on the terrain
    P Brightness = max(0,DotProduct(PN, LightDirectionNormal)) * Light Brightness

for each P on the terrain
    for each SP within a certain distance
          if SP is within horizon
              FinalPointBrightness = P Brightness + SP Brightness *max(0,DotProduct(PN, SPN))/(distance from P to SP * constant)

would this work in realtime? if i have a precalcualted horizonmap

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!