Wednesday, June 22, 2011

Photon mapping ownz!

Hi there, it's been a while.

I've implemented progressive photon mapping, first exactly as it is in original paper (constructing hitmap once and shooting photons in the main loop), it was all nice and fast but quite troublesome, especially if it comes to antialiasing and glossy materials.
Then i've implemented the more basic approach to PPM as in this paper.

But I have some isues as for now:
  • I am not sure about the adjoint bsdf for shading normals. What's obvious is smooth normals didnt work out of the box for the lambertian. What I did is using original normal, and scaling contribution by |in*nor_s| / |in*nor_g|, kinda works but I am not sure. What with other materials? For specular and dielectric it seems to work with just smoothed normal in place of the geometric one.
  • Since I'm still using Java I have problems with Garbage Collector, I build uniform grid for 100000 - 200000 photons every pass on all 8 threads separately and that really kills the GC, even if I try to reuse the grid. Any suggestions?
  • Shading on hard corners, for example 90 degree corners between the walls. Right now I use simple hack to check for the angle between the photon and surface normal, but that makes them black, the blackness does shrink over time but doesn't seem to ever disappear. So I wonder if it wouldn't be a better choice to leave it alone converging to the right sollution in +inf time and 1/inf radius (?)
Other than that it's blazing fast. This image took around one hour to render:


But was already pretty good after minutes.

3 comments:

  1. Your first point is a classic problem in bdpt and it is discussed thoroughly in Veach's thesis. Other than that, I like this render especially the indirectly visible caustics which is really hard to get with that level of smoothness.

    Keep up the good work :)

    P.S. How is your progress on bdpt?

    ReplyDelete
  2. Thanks, I know, I know. I've seen your thread "issues with light tracing". I've skimmed it (veach thesis) thus that simple solution, which seems to work, so far.

    If it comes to bidirectional - I didn't go any further than when I left it back then. But seeing how ppm (with direct lighting) is fast and easy. I don't feel like diving into bdpt madness again.

    ReplyDelete
  3. "I've implemented progressive photon mapping, first exactly as it is in original paper.." - That's the problem with Jensen & Co - at least once a year they produce a paper describing super-adaptive-enhanced-5D-multi-etc. photon mapping which clearly outperforms every other algorithm, then next year there's a new paper admitting that previous photon map algo was unusable as it failed on glossies miserably - are you guys serious? You didn't check it on scenes containing glossy reflectors? Then it's next paper admitting the last one wasn't great either since it was only able to render a torus in the glass cube. There are lots of problems like this - light leaks, caustic fuzziness - of course they now about it, just don't tell leaving it to other people to sort out. A bunch of wankers...

    ReplyDelete