Setting up FG
FG or Final Gathering is the final stage of "photon mapping" rendering. What it does is it computes GI only at important points in an image. This points are selected more densly by Kray on places where it is most likely for a shadow to occur.
First we need to change Diffuse model on General tab to
Photon mapping with
cache irradiance turned on.
Then let's turn FG preset to medium
and see what we get.
Now that's not bad at all!
Thank you for your attention and happy rendering!

just kidding...
The outcome is quite good but we'll do some optimizing just to show you what you can tweak.
From here on we'll go more deeply into how to optimize KRay.
One of the most important things with FG is correct density of samples. If the samples are spread too far appart the shadows will look blurred, if they're too close you'll need more rays to get clean rendering.
We have couple of controls to control this. The most important ones are:
FG threshold FG rays min and FG max.
- FG rays min is the minimum amount of rays Kray will use at specific point.
FG max is maximum number of rays at specific point.
FG Threshold is the difference between to sampled points. When the difference is bigger than specified value Kray will increase number of rays untill it reaches maximum number of rays (FG max).
When number of rays are too low, you will begin to see splotches. When number of rays are too high you'll get longer render times than needed. So the trick is to find a balance between render times vs. quality.
We will first check where Kray computes FG points. To do this we need to turn prerender to 0%, next turn on show samples "All" and just for the sake of faster rendering let's turn FG rays max to 100. Also go to sampling tab and set Antialiasing to "none".
We get this render:

[/img]
You can see how Kray places samples (the pink dots) at "strategic" places where it expects shadows to occur. On large flat areas there are very few sampled points because KRay knows lighting won't change much there. On places around corner there are alot more samples to accurately compute shading.
The density of samples seems a little sparse in the above image so we will make them closer. We can do that with couple of advanced settings so this is the part where we will unlock "advanced settings". Select "custom" from the preset list and settings will get unlocked.
The setting that influences density of samples the most is "spatial tolerance". Right now is set to 0.2 but we'll set it to 0.1 and how density of samples changes this way.
You see how the samples are positioned much closer now. This will create more accurate shadows in those places. We can further tune samples with following settings:
Distance Min/Max = this controls minimun and maximum distance between samples. If min and max are exactly the same, samples will be distributed equaly appart across all surfaces (and we don't want that).
B/D = this value will add more samples but only to places with high light contrast (corners). This can further improve quality of shadows if needed. I like to keep this value between 0-100% depending on the scene.
This is image with B/D set to 0%. You can see how samples in corners are not as dense as before.
I will now turn B/D to 50% since default 100% seems a bit high...
This looks good to me, we're gonna turn off "show samples" now and tweak FG rays. Let's try this settings first and see if it's good enough: FG threshold 0.0001 FG rays min 100 FG max 600.

That looks pretty cool. You can see we get better shadows now than before when we used medium preset. I can't see any splotches either. I think I'm gonna try with even lower FG max to get faster results. Let's try... hmm.. max 300.
You can start seeing some artifacts in the corners and shadows start to fade away also... But we gained 2 minutes. So it's up to you to decide which way you want to go.
All there's left now is add some antialiasing. We'll cover Antialiasing in some other tutorial since that needs a bit more explanation. For this tutorial I'm just going to select a medium preset for a start and then customize some settings.
Upsample we can turn to 0 since this is used when you have fine details in your image that normal resolution cannot capture.
Z distance is also a little bit low so I'm gonna turn it up a bit. That's it.
Here's our final image. (yea I know it needs some surfacing and lighting polishing but that's where you come in!)
Here's a final scene file if you wan't to test it yourself...
http://www.vizualizacije.com/kray_tut/final.lws
Hope you enjoyed this and I hope to hear your questions and comments!