Jump to content
  • Advertisement
Sign in to follow this  
Lightness1024

I'm building a photonmapping lightmapper

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

Advertisement

Awight, there we go, the drawing:

 

1o70w1K.png

Ok so with this, it's much clearer I hope, the problem is by what figure should I be diving the energy gathered at one point ?

The algo works this way:

first pass is direct lighting and sky ambient irradiance.

second pass creates photons out of the lumels from the first pass.

the third pass scans the lightmap lumels and do the final gather.

The gather works by sending 12 primary rays, finding k-neighbors from the hit position, tracing back to origin and summing Lambertians.

Normally one would think we have to divide by number of samples, but the samples can vary according to photon density, and the density is not significant because I store a color in them. (i.e. their distribution is not the mean of storing the flux like in some implementations)

Also, the radius depends on the primary ray length, which means more or less photons will be intercepted in the neighborhood depending if it hits close or far. And finally the secondary rays can encounter occluders, so it's not like it will gather N and we can divide by N. If we divide by the number of rays that arrive at the origin, we are going to have an unfair energy boost.

I tend to think I should divide by the number of intercepted photons in the radius ?

 

Edit: that's the photon map visualizer. I made so that colors = clusters.

photocloud.png

Edited by Lightness1024

Share this post


Link to post
Share on other sites

Ok little report from the front.

I figured that one big problem I have is a problem of precision during reconstruction of the 3d position from the lumel position.

I have a bad spatial quantization, using some bias helped remove some artefacts, but the biggest bugs arn't gone.

 

anyway, some results applied to real world maps show that indirect lighting shows and makes some amount of difference:

 

(imgur album)

 

coBmvaW.jpg

hfcyC7f.jpg

 

B8km42g.jpg

ySgy6ms.jpg

 

WrCx70m.jpg

pURIJaH.jpg

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!