Yaf(a)ray quick settings guide: photon mapping
When I was trying to get deeper into YAF(A)RAY I never really knew how exactly the settings affect the rendering. I decided to create set of example renderings to show the same scene rendering with different values for each settings. And because I did not see anything similar to this concerning YAF(A)RAY, i decided to share it here. The YAF(A)RAY User's guide by Alvaro Luna Bautista is great as a overall review but the description for each option is very brief and does not explain deeper, so it leaves a poor YAF(A)RAY rookie with testing anyway. I must not forget to mention this great tutorial originally by Tom TNT, which is a great knowledge base for understanding GI in general.
The purpose of this guide is to help speed up decision making during setting up the YAF(A)RAY in the workflow. For a descent rendering, obviously, one has to know what each value represents. Because putting high values does not necessarily mean good result. And it allways costs extra time. So for each of the value there is I produced several images to show what difference it makes. I also add the possible range of each of the values. For this study of GI I created very simple scene with openings on one side to create situation with compliacated play of light and shadowy areas. I used crazy wide-angle camera so you could see more. For the light I used one sun lamp with 1.4 strenght and 20 samples. For the sake of simplicity I used clay render without any materials. I added some balls to show how the light interacts with objects inside. In the first part of the guide i will try to compare different values of the settings in between them. In second part I will compare FG renderings with its corresponding shown photon map.
If not stated otherwise this is the setting I was using for the renderings. The "Final gather" and "Show map" buttons are being switched on and off, depending on an image.
PHOTON MAP WITHOUT FINAL GATHER
So I would say that it is very important to understand this well in order to work properly with the Final Gather later.
And now let`s start with the Depth setting.
Depth (0 - 50)
This setting controls the number of bounces of the photons cast in your scene. The higher this number, the smaller contrast between the shadow and the bright areas. It also increases the overall brightness of the scene. Setting the right value here means finding the best compromise between contrasty/dark and washed-out/bright scene.

Photons (0 - 100.000.000)
This settings is used to adjust the number of photons to cast. Higher numbers increase the overall quality of lightning {when used with FG it reducces artifacts in corners.} I would think of this as of a resolution of used photon map. When u increse the value, the photon map is more dense, so u have more information passing to FG and thus hiigher quality.

Diff. radius (0 - 100)
The Tool Tip of this button tells you that this is a radius to search for non-caustic photons. Based on my tests I would dare say this is simply size of the photons. To be even more brave I say this sets the size of a photon in world blender units. If we were to use sheer photonmap for illumination, we would need less photons to completely cover our surface if they were of bigger size. But such a photon map would be less precise, since it would have less "pixels" to carry the information os color and brightness.
There is another very important thing to know about this setting. But first I have to explain something about yafray`s photonmap behavior in general: I found out during the tests that a surface gets illuminated by surrounding shining objects (by accepting photons that previously hit this surface) if the angle between surface`s normal and the direction of light is greater than 90 degrees.I suppose this is a bug because it should observe not the angle between the light and the surface`s normal but the angle between two surface`s normals. If you look at the example image below, the test-plane I put in my scene is illuminated by the photons that previosuly hit the bright outer wall (yellow line).
This obviously should not happen in realistic simulation because the normals point the opposite directions.
And now back to the Diff.radius. If the photon size is bigger than the thickness of you wall, it will show in your rendering. For this scene it was using diff.radius > 1, where the wall was 2 units thick. But because this value is radius of the photon (not diameter) you have to double it. IMHO this option should be called photon size not to lead to further confutions. But I may be missing something important here... In the comparison images bellow you see this as a bright line along the corners.

Search(0 - 10.0000)
For better illustration of this lever I decreased number of photons in the scene to 5.000 and increased the size of photons to 5. Because this setting would affect your rendering locally, i used zoomed cutouts for examples.
This setting is used for blurring the photonmap to become less dotted/spotchy. I would not know the exact algorithm, but it works with overlapping of the photons. Based on the set value it searches for the spots where this many photons overlap and these spots become the bright spots. Then, it is faded out towards the edge of the photon. The distance between this edge and the center of the photon is based on the diff.radius value. Places that overlap less photons are darker, even less darker and so on until there is only one photon with no overlapping. This photon has the brighness that is set by the emitter`s power setting in our case the sun.
Now you understand that the Global Illumination based on photonmap is derived on the density of these spotches/photons (not by the enrgy or anything else). Points with more photons overlapped become brighter places in the rendering and points where there are only few or no photons become the dark spots on the other hand. I recon this is the essential knowledge for understanding and then mastering the photon-based rendering.

FINAL GATHER: WORKING WITH PHOTONMAP
This part of the guide covers rendering with Final gather algorithm, that is with the "Final Gather" option in the photon settings section turned on. It shows how different settings can result in different quality of the FG render. In the first column there are renderings with the "show map" option on. This lets you quickly preview the photon distribution before during the process of setting the GI.

DEPTH
As I said before this value is predominantly about contrast. If you go up for high values, the renderings tend to be without contrast/depth, because as the photons bounce again and again around it covers the whole scene with uniform light. If you set low values on the other hand the rendering would be too dark. So be aware of this especially when using simple scenes like this with not as much contrast on its own.
Another thing to mention is that when you have areas that are covered with photomap texture and areas with no photons next to it, it produces some nasty artifacts in the corners (when this happens on a flat plane its ok) that is especially noticable in the second image example set (depth=5).
The last set of example images has the best feeling of a daylight-filled room. But It is better to compensate for this by increasing the number of photons in the scene rather then depth for stated reasons. Well let`s see if we can have the best of the both worlds; a high contrast and a daylight-feeling at the same time by setting one of the options described below.

PHOTONS
I would say this setting is about the quality. Although the FG does a pretty good job with such little information it gets in the first set of example (photons = 10.000), the next images show that some increase of rendering time (for casting extra photons) is just worth it. In the last example (photons = 2.000.000) is some quite good lighting already.
To sum it up: to have more photons cast means to have less noise and less artifact after FG pass.

DIFF.RADIUS
It is proved here just well that gappy photonmaps would produce artifacts in the corners. To fix this, you could either increase number of photons immensely or just increase this value. So these two setting can work together should be allways changed at the same time. The noise on the walls can be reduced by increasing FG samples.


SEARCH
In the first set (search = 2) the photons are mixed together so little that some areas are almost as bright as the ones lit by direct sunlight. That is because every two photons create the brightest spots and there is no space for other tints. If you set this to five (search = 5 then five photons need to overlap to create as bright spot as in the previous example. If there are not as many overlapping photons in the scene as the number you set, the highest number found is being used. That is why from certain value of search up the rendering would not change.

FINAL GATHER: QUALITY SETTINGS
The base settings (apart from the very setting being tested) was like this:

FG Samples
Number of samples for final gathering process. The more samples are taken, the less noice there will be in your rendering. I don`t thing more words are needed here, the images below speak for themselve.

FG bounces
Tool tip: Allows gather rays to extend to path of this length. Wouldn`t really know whats going on here. It reminds me of that newspaper game for children; find ten differences. But this is no beginner`s level, huh? Might edit later as well:)

Use background
And finally let me not forget about this little button in the top right corner of the settings panel. It is the "use background" button. When it is on, it includes the background that u set in the background settings part of the panel into the computation of GI. It can make your render much more realistic. You can control the amount by "power" lever down in the background settings. I Also increased that approx. to 3 so that the difference is more clear. The effect you can see in the window`s area when it gets a blueish tint.
Note: When saving in png file format, there is an option in the render window to turn the alfa off. That can show handy when you want to play later with the background, because it will not be saved and you will get "holes" instead.

I skipped the caustic mix button on purpose, because it would require different scene for investigation. I might add this later. I will continue with other rendering methods later as well like pathtracing etc.
And this is how the final result could look like if I try to consider the things above. Note that it is very dark, and it would probably be even darker in real. But then what is wrong with my space? Maybe the windows should be bigger, huh? ;) So with setting values low to speed up the rendering it can work as a design tool for architects, which is gr8!
The sun now produces sharper shadows nearer to the windows and softer when its deeper in the space. I thing you would have to use area lights to fake this effect in the YAFRAY. (Correct me if I am wrong there) That is very neat. One thing that kept me wondering was why the wall in the back was darker than the one on the left. Because I thought that a wall perpendicular to the light source must have just more light than the one in 180 angle to it. Well, thats where the photonmaps got quite handy. In image with the depth = 1 all the way up here, there is quite good answer; the windows of the room are so slow and the angle of sun is such that photons fall very deep in the space. Then bounced photons would fall back on the wall with the windows with more probability than on the back wall so it would become more illuminated. Quite interesting.
And that would be it for now, I hope this would show handy to someone and if not, never mind, I learned a LOT! Also note that this can live to some changes in the near future if I find things to be changed
Cheers and keep blending:)