33
KERKYTHEA GI (Global Illumination) Photon Mapping(Indirect+Direct) Part 1 In this chapter we will Analise the basics of Kerkytheas Global Illumination solution . I will show you how the different settings affect your final image . I am going to use tow systems , the Photon Mapping (direct+indirect) and Photon Mapping + Final Gathering (SW) in Part 2 of this chapter. For this chapter i will use a interior scene with one omni light and sharp shadows . Before wee use Photon Mapping + Final Gathering (SW) to produce our final render , lets take a look to the Photon Mapping (direct+indirect) and see what it dose and for what it is good for. Go to the tool bar and under “Render” select “Setup”. A panel like this will show up This is the Render settings Menu . We don't need Antialiasing at this moment so set it to “None” . “Fuzzy Tracing” is needed for materials like blur reflections and other shader . I will go into this in the chapter related to materials/shader . But in the indoor scene i am going to use,there is no need for “Fuzzy Tracing”,so set it to “No Tracing”. Keep “Soft Shadows” to

Gi kerkythea tut

Embed Size (px)

Citation preview

Page 1: Gi kerkythea tut

KERKYTHEA GI (Global Illumination)

Photon Mapping(Indirect+Direct) Part 1

In this chapter we will Analise the basics of Kerkytheas Global Illumination solution .I will show you how the different settings affect your final image . I am going to use tow systems , the Photon Mapping (direct+indirect) and Photon Mapping + Final Gathering (SW) in Part 2 of this chapter.For this chapter i will use a interior scene with one omni light and sharp shadows . Before wee use Photon Mapping + Final Gathering (SW) to produce our final render , lets take a look to the Photon Mapping (direct+indirect) and see what it dose and for what it is good for. Go to the tool bar and under “Render” select “Setup”. A panel like this will show up

This is the Render settings Menu . We don't need Antialiasing at this moment so set it to “None” . “Fuzzy Tracing” is needed for materials like blur reflections and other shader . I will go into this in the chapter related to materials/shader . But in the indoor scene i am going to use,there is no need for “Fuzzy Tracing”,so set it to “No Tracing”. Keep “Soft Shadows” to

Page 2: Gi kerkythea tut

“Lowest” ,this settings are for lamps with soft shadows on , having only one omni lamp with sharp shadows in the scene ,there is no need to use this setting . I will explain this setting in the chapter related to lights . The “Max Depth” setting has a relation with transparent materials like glass and will by explain t in the material/shader chapter. Set it at 5. Now lets go to the Global Illumination Panel

Under “Method” select “Photon Mapping (direct+indirect)”. This Method will generate a image by shooting photons . Set “Mesh Detail” to 0 (this setting affects the density estimation . 0 setting let kerkythea “guess” the density estimation). Now i am going to do some renders with different amount of photons (very Few -500 , Few -2000 , Moderate – 10000 , Many – 100000 , very Many -1000000 , A Lot – 10000000 ) . Lets see how the different amount of photons affect the quality and the render time .

Page 3: Gi kerkythea tut

Image 1

Ok ... this image is relay bad . There are no shadows and the color is strange . Way dose this happen ? The answer is that we used only very few photons 500 . Shooting more photons shut help to get a better image . But first lets have a look at the console log . Here wee can see some interesting and important things . The Density Estimation made bay kerkythea is7.09021m detail in mesh generation ( remember that wee put 0 in the Mesh Detail setting on the GI Panel and that makes kerkythea “guess” the density estimation).Photon shooting time (0 seconds) and the render Finished in 6 seconds

Lets go to the next image.

Page 4: Gi kerkythea tut

image 2

I used 2000 photons but the image still looks bad . But looking at the console , the density estimation has changed to 3.5451m and rendering time still 6 seconds.Hmmmm ..... next image please

Page 5: Gi kerkythea tut

image 3

Shooting 10 000 photons makes the first shadows show up a bit . But still no usable image.Density estimation gos down to 1.58542m and render finished in 7 secondsIt looks like wen you increment the photons kerkythea reduces the density estimation. Keep that in mind !!!

Page 6: Gi kerkythea tut

image 4

Oh..... it is starting to look better . Now the colors are not so strange any more and the shadows are much clearer . It is a little bit blurry but ok. That took use Many -100000 photons to shoot . Density estimation went down to 0.501353m (like predicted ) and Photon shooting took 3 seconds . Render finished in 17 seconds . One moment ...!? 17 seconds – 3 seconds = 14 seconds . For what dose kerkythea use the 14 seconds ?The answers mi friend is blowing in the wind ... ok kerkythea uses the 14 seconds in what you can see in the console called “Building Meshes” . This is some thing you have to keep in mind !!!!!! . It has a relation with the density estimation value . When density estimation gets smaller the building meshes time grows !!!!! . In the next image wee can see it more clear.

Page 7: Gi kerkythea tut

image 5

Here I shoot very Many 1000 000 photons . The shadows are getting more defined and the image more accuracy . Looking at the console log the density estimation shrinks to 0.158542m and photon shooting time took 38 seconds . Render finished 1 minutes and 34 seconds .Making a calculation the building meshes took 56 seconds . It takes the big es part of the howl process !!!! Lets see what happens when shooting 10 000 000 photons .

Page 8: Gi kerkythea tut

image 6

Photon Shooting 392 seconds and Render finished in 16 minutes and 49 seconds !!! This image took 15 minutes and 15 seconds longer then image 5 and it looks nearly the same but it have more noise . Way ?It has to do with the density estimation that is now at 0.0501353m . The density estimation controls the triangulation (maximum length of output triangles in meters).So if you have a noisy image you shut increase the “Mesh Detail” in the GI panel and if it is too blurred decrease the value . But you have to by very careful with this setting . If you supply a dummy value , it could make memory requirements go infinite !!!!!!!!!!!And here gos another advice . Even letting kerkythea “guess” the density estimation , if you put a huge photon shooting value like 100 000 000 and depending on your scene, it could make your HD go for a looooooonnnnng time . This is the console log for 100 000 000 photons .

Density estimation 0.0158542m and Photon shooting time 4014 seconds = 1 hours 6minutes 9 seconds only for photon shooting!!!! You see I stop the Building Meshes after another hour seeing mi HD running so loooonnng ! And I have 1G of ram !!

Page 9: Gi kerkythea tut

So what can we do to prevent this situation ? Mi advice is to always use first the Method“Photon Mapping (Direct+Indirect)” with Photons set to Moderate -10 000 and “Mesh Detail” to 0 ( let kerkythea guess ) . In most cases you will have a quick render and then look in the console log to see what kerkythea “guessed” for the density estimation .Knowing this value let use calculate the density estimation for more photons . Here is on example . Were shooting 10 000 photons like in image 3 lets look again at the console log

Density estimation = 1.58542 Now if wee multiply our photons by 10 , kerkythea will divide the density estimation by 3.16228 more or less . Lets try 10 000 * 10 = 100 000 and 1.58542 / 3.16228 = 0.501353The console log for 100 000 photons is like in image 4

If wee multiply our photons by 100 Kerkythea will divide the density estimation by 10 .So 10 000 * 100 = 1 000 000 and 1.58542 / 10 = 0.158542 The console log for 1 000 000 photons is like in image 5

With this method wee can prevent Kerkythea from go under density estimations <= 0.0158542m . And wee have total control over quality and time for our image .

But what can wee do if wee have a image that needs more photons but wee don't want the density estimation to shrink to much . Lats take a look at image 4 and the console log againand compare it with image 5

Page 10: Gi kerkythea tut

Image 4

Image 5

console log image 4

console log image 5

Page 11: Gi kerkythea tut

Image 4 is not too bad but it is a little bit blur . Giving it more photons would make it more accuracy and reducing density estimation less blur .Image 5 is more accuracy but the rendering time for image 4 is 17seconds and image 5 1 minutes and 34 seconds . So it would by nice if wee could reduce render time for image 5and keeping the accuracy of the image . Knowing that the process of “Building Meshes” takes most time of the howl process and it is related with the density estimation , wee could use a density estimation value between image 4 = 0.501353 and image 5 = 0.158542Here I try with a density estimation(Mesh Detail) = 0.3 and photons = 1 000 000 like in image 5 .

Page 12: Gi kerkythea tut

image 7

you can see in image 7 that the accuracy is good and it is not to blur. The render time shrink from 1minute and 34 seconds for image 5 to 55 seconds for image 7 . The shooting time for photons 35 seconds remains more or less the same like in image 5 (wee used the same amount of photons like in image 5).This way wee made a mixture of image quality/time from image 4 and image 5 .

Now wee a ready for the next step that will turn our image into a smooth good looking final render “Photon Mapping + Final Gathering (SW)” . But first lets see way wee use “Photon Mapping (Indirect+direct)” at the first time and not the “Photon Mapping + Final Gathering (SW)” that is the one that makes the nice image? It looks like a wast of time .Yes and no . You can go striate away and skip this step and use “Photon Mapping + Final Gathering (SW)” , but when you do your render , have a look at the try bar at the left and you see that Kerkythea shows you the actual process he is working on .There are 4 main process :Photon shooting ,Building Meshes,Ray Tracing and Antialiasing.With “Photon Mapping (indirect+direct)” wee are able now to control the image quality that the “Final Gathering” will base his calculations on and the Photon shooting time + Building Meshes time , 2 of the 4 processes that wee have using “Photon Mapping + Final

Page 13: Gi kerkythea tut

Gathering (SW)”.

It is important to know that photon Mapping quality is important for the Final Gathering result . “Photon Mapping + Final Gathering (SW)” takes longer to render then “Photon Mapping (indirect + direct)”. So working on a huge render with a lot of details using only “Photon Mapping + Final Gathering (SW)” will make it harder to see what setting you have to tweak . And in the end you would have spent more time tweaking your settings then first using “Photon Mapping (indirect+direct)” and then going to “Photon Mapping +Final Gathering (SW)”. In mi opinion it is a good work flow to use first “Photon Mapping (indirect + direct) and then go for “Photon Mapping +Final Gathering (SW)”

Resuming :

The Mesh Detail (density estimation) setting controls the Building Meshes time and the blur/noise of the image.Mesh Detail setting = higher =Building Meshes time = shorter ( can make image more blur )Mesh Detail setting = lower =Building Meshes time = longer ( can make image more noise )The amount of Photon shooting affect the Photon shooting time and the accuracy of the image .less Photons = Photon shooting time = shorter ( image less accuracy )more Photons = Photon shooting time = longer (image more accuracy)

Photon Mapping+Final Gathering(SW) part 2

Now lets go to the Render Panel again an this time I am going to use Antialiasing and “Photon Mapping +Final Gathering (SW)”

Page 14: Gi kerkythea tut

I am going to use Interactive Pass 3x3 and AA Threshold 0.3

Wen we use the Method “Photon Mapping + Final Gathering (SW)” there are now more settings we can use .I will use in this part the settings I used for image 4 Even the image is a bit blur I wont to show what the Final Gathering can do with it.Photons to 100 000 – Many and Mesh Detail to 0In the caustics settings I sett Method to None and lat Density Count at 64 (default value)(I am going to explain this settings in the chapter related to Materials/Shaders )In Final Gathering I sett Accuracy to 0.5 – Coarse and Gathering Depth to 1 .Now I am going to do some renders with different Rays settings : 80 – Few , 200 – Moderate , 500 – Many , 900 – Vary Many , 1600 – A Lot and 2500 – Huge .

Page 15: Gi kerkythea tut

Image 8

Page 16: Gi kerkythea tut

image 9

Page 17: Gi kerkythea tut

image 10

Page 18: Gi kerkythea tut

image 11

Page 19: Gi kerkythea tut

image 12

Page 20: Gi kerkythea tut

image 13

Looking at the images 8 to13 we see there is nearly no different . The only thing I can seeis that in image 8 , in the background where the big “K” is on the left , are black spots and in image 13 they look more blur ore faded . Render time increase from image 8 = 31 seconds to image 13 = 1 minutes and 58 seconds . But the image real don t look god . So I am doing again some renders but this time with Accuracy sett to 0.25 – Moderate and increase again the Rays like I did here .

Page 21: Gi kerkythea tut

Image 14

Page 22: Gi kerkythea tut

image 15

Page 23: Gi kerkythea tut

image 16

Page 24: Gi kerkythea tut

image 17

Page 25: Gi kerkythea tut

image 18

Page 26: Gi kerkythea tut

image 19

The image looks better now and it is more accuracy . The render time went fromimage 14 = 37 seconds to image 19 = 3 minutes and 50 seconds . But if we compare image 13 (Rays = 2500 – Huge and Accuracy = 0.5 – Coarse ) with image 14 (Rays = 80 – Few and Accuracy = 0.25 – Moderate ) , image 14 looks better then image 13 and the render time is only 37 seconds for image 14 and the render time for image 13 = 1 minutes and 58 seconds !!!

Page 27: Gi kerkythea tut

image 13

image 14

Have a look at the small “K” at the right side in the shadow . The light is more accuracy in image 14 then in image 13 . So what do the different setting Rays and Accuracy ?This is a bit difficult for me to explain because I am not a programmer and don t know to much of the technical part of GI . But when you have blotch spots in your image , increasing the Rays will help to smooth out and get away with them . For “isolated” mostly dark blotch spots (some times look like a pattern ) , you shut increase the Accuracy setting .

Now you may say that way dot we just use the best setting in both the Rays and the Accuracy setting , so we will have the best image . Yes you are right ... but what will be the

Page 28: Gi kerkythea tut

cost in rendering time . Have a look at image 20

image 20

This is the image with Ray = 2500 – Huge and Accuracy = 0.0 – Perfect The different between image 14 and image 20 are visual not to big but in render time...image 14 = 37 seconds !image 20 = 1 hours, 49 minutes and 48 seconds !Mi recommendation is to start with Rays = 200 – Moderate and Accuracy = 0.15 – Goodor 0.1 – Very Good .

Now I am going to do the final image

Page 29: Gi kerkythea tut

image 21

And here are the settings : Rays = Very Many – 900 and Accuracy = 0.1 – Very GoodThe deferents between image 20 and image 21 are very very little but image 21 took 2 minutes and 46 seconds !1 hours, 47 minutes and 2 seconds less then image 20 !!!But looking at both images I see some minor Antialiasing problems . They are not very important but I am going to fix that .

Before we go to part 3 “Antialiasing” I would like to make a kind of analogy that may help to understand the “Photon Mapping +Final Gathering (SW)” . I think of it like if I would paint a Room or apartment . First you use a big brush or a roller and do the heavy work (Photon Mapping) and then you use a smaller brush for the corners and the small areas around the

Page 30: Gi kerkythea tut

doors and windows (Final Gathering) , it would not make sins to use a small brush to do the heavy work (Mesh Detail to small) ore to use not sufficient painting and leave big gabs between every stroke (not sufficient Photons) so later with the small brush (Final Gathering ) you have to do to much extra work and it will take longer .I know that this analogy is not very accuracy at all but it may help in the beginning .

Antialiasing part 3

The Antialiasing is used to smooth out the jagged edge of the image . It has a relation with the Rays and Accuracy settings of the Final Gathering.If you use high Rays and Accuracy settings the Antialiasing will slow down tremendous .I show it here with some console log

No Antialiasing Rays = 2500 – Huge , Accuracy = 0.0 – Perfect

Antialiasing AA Threshold = 0.3 , Rays = 2500 – Huge , Accuracy = 0.0 – Perfect

We can see looking at the rendering times that AA toke 47 minutes and 19 seconds !

Some more renders and console log

No Antialiasing Rays = 900 – Very Many , Accuracy = 0.0 – Perfect

Page 31: Gi kerkythea tut

Antialiasing AA Threshold = 0.3 , Rays = 900 – Very Many , Accuracy = 0.0 – Perfect

Here the Antialiasing toke 17 minutes and 25 seconds !!!The only setting we change was the Rays setting from 2500 to 900 !!!So you can see that the Rays setting has a impact on the Antialiasing time .But may by the Accuracy setting has more impact on Antialiasing time then Rays settings ?Lets have a look at this console log

No Antialiasing , Rays = 2500 – Huge , Accuracy = 0.1 – Very Good

Antialiasing AA Threshold = 0.3 , Rays = 2500 – Huge , Accuracy = 0.1 – Very Good

Page 32: Gi kerkythea tut

The Antialiasing toke 2 minutes and 35 seconds It looks like the Accuracy setting has more impact in the Antialiasing then the Rays setting .In fact the Accuracy setting has an over all impact on the render time . So by careful with the Accuracy setting !!!

For the final image i will reduce the AA Threshold = 0.1 that will make the Antialiasing slower but finer .

Here is the final image

image 22

Page 33: Gi kerkythea tut

Render time 3 minutes and 8 seconds !

Here is the GI Panel for our final image

(The image resolution for all images here are 640x480 and render on a AMD Athlon64 3200+ with 1G ram)

I hope that this chapter for the basic of Kerkytheas GI solution will help you to get good images in good render times . Patrick Nieborg a.k.a. Patricks