QUICK GUIDE FOR “PHOTON MAPPING” IN YAFARAY


The information in this guide can be found in this thread in the Yafaray forum: link to "Interior Lighting, Noise and DiffRadius Researching.


TRICKS AND TIPS FOR PHOTON MAPPING
...Basically, you have four result-levels for photons:
* Type 1. Dots or "blood cell" circles: Means you are looking up too few of them
* Type 2. Well covered but "cloudy"/"splotchy" (not smooth): Looking up a tad too
few
* Type 3. Smooth and detailed: "just right"
* Type 4. Over-smooth and totally smeared : Looking up too many / too large radius
Basically, the photon search stops when either the radius is reached or the count is reached. So if you set it to 100 photons, 10 cm, it will look within for the 100 nearest photons within 10 cm.
* If the 100 nearest are within 1 centimeter, those 100 will be used, none further than 1 cm will be used
* If the 100 nearest are within 10 cm, they will all be used.
* If the 100 nearest are within 1m, only those within 10cm will be used.
From this you can trivially understand that if you hit the "number limit" this acts as an adaptively variable radius... the more photons, the better the detail, the less the photons, the more radius is looked up in.
However, if the count is too high, the radius is always hit first. So you will always "smear" the result over the radius. This is oversmooth (type 4 above).
The trik is to get to type 3 "just right", but the good thing is that when combined with FG, the accuracy need is much less. The cloudy (type 2) solution works just fine with FG. A spotty/circly (type 1) solution wont work, a over-smoothed (type 4)
solution "works" but can put light where it's not supposed to be.
So with FG the "margin of error" is large.
My workflow is generally:
1. Turn off FG
2. Look at the photons-only result
3. Is it dotty? Increase radius, or photon count, until it stops being "dotty"
4. Is it super-smeared, decrease radius.
5. When neither "dotty" nor "super smeared" (generally "cloudy" or "nice"),
be happy
6. Turn FG bak on.
7. Rejoice.
• GOOD APROXIMATION EXAMPLES
It´s better if we don't consider Diff Radiusvalue alone, but a as a combination of both Diff. Radiusand Search. I mean, it is the number of photons found (Search) within a radius (Diff Radius).
If you decrease Search, there are less photons to mix therefore the likeliness to average a different result than the neighbour patch increases, hence the more noise.

Guia rapida para   photon mapping   en yafaray-1.jpg
Search 20
Diff Radius 1.0
Photon Count 200.000

If you increase Search, there are more photons in the mix, therefore the likeliness to average a different result than the neighbour patch decreases, hence the less noise.

Guia rapida para   photon mapping   en yafaray-2.jpg

Search 150
Diff Radius 1.0
Photon Count 200.000

Diff. Radius is the size of the photon map patch. If we decrease the size, we are increasing the signal frequency, there are more patches therefore is a more precise photonmap, but at the same time the noise produced by Searchis increasing its frequency.

Guia rapida para   photon mapping   en yafaray-3.jpg

Search 20
Diff Radius 0.1
Photon Count 200.000
So better we use a good Searchvalue. However, as we decrease Diff Radius, there are some patches that aren't getting enough photons for Searchto mix, hence that group of patches will have got less luminance. An insuficient photon countwill introduce low frequency noise again, even on a high resolution photon map.

Guia rapida para   photon mapping   en yafaray-4.jpg

Search 150
Diff Radius 0.1
Photon Count 200.000

Photon count should be increased as Diff. Radius decreases:

Guia rapida para   photon mapping   en yafaray-5.jpg

Search 150
Diff Radius 0.1
Photon Count 2.000.000
150 search

Now that's a photon map ready for Final Gather to mix!