IPB
AM:Stills * AM:Films

Welcome Guest ( Log In | Register )

5 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> The Cornell Box Tutorial
ypoissant
post Nov 24 2004, 07:42 AM
Post #1


Master
**********

Group: Hash Fellow
Posts: 2,499
Joined: 18-September 03
From: Québec city, Québec, Canada
Member No.: 70
Programmer: Yes
Contests Won:*



The Cornell Box tutorial Part I

IMPORTANT NOTE: The renders in this tutorial have all been corrected with a Gamma of 2.2.

So here is the Cornell Box in all its glory:
user posted image
And this is the scene we are going to use for the tutorial.

The Cornell Box is probably the oldest scene used for comparing radiosity rendering engines. The most popular configuration is described at the Cornell University Program of Computer Graphics Cornell Box data page.

For this tutorial, I invite you to download the A:M Cornell Box project. This is the actual Cornell Box data I modeled in A:M from the published specs for both dimensions and surface properties.

Here are a few things to note about this scene:

First thing to note is this scene is small. Very small compared to a normal room size. The room itself is 55cm wide by 55 cm high by 57 cm deep.
user posted image

It is important to note that the Cornell Box is small relative to a normal room because room size have a major influence on the way Photon Mapping properties should be set.

Second thing to note is the light arrangement.
user posted image

The cornell Box is illuminated by a signle flat diffuse luminaire. To simulate that, I arranged 25 klieg lights in a 4x5 array. This is actually one klieg light instanced 25 times in the choreography.

Third thing to note is how the klieg light is setup. To simulate the way a flat diffuse light illuminates a scene, the klieg's Cone Angle is 180° and the Width Softness is 100%. The 100% Width Softness ensures that illumination falls-off at a cosine rate according to the angle from the light surface. This is how light from a flat surface behaves in reality.

Fourth thing to note is the klieg's Fall-Off distance.
user posted image

The Fall-Off distance should be set is such a way that it doesn't touch any object in the scene. In this scene, you can see that the Fall-Off stops short of touching the walls and the tall bloc. This is especially important when the light intensity is small to ensure that all objects will be directly illuminated in a natural way. The Fall-Off distance could be shorter but ideally not touch any objects in a scene. Sometime this is not really achievable. When this is not possible, then there are other rules to take care of.

Fifth thing to note is the low light intensity.
user posted image
This is a Raytrace render of the Cornell Box.

For Raytrace render, you would probably want to have higher light intensity. But for Radiosity render, because the surfaces will also contribute light in the scene. light intensity are lower. In fact, light intensity can really be adjusted by trial and error in Radiosity render mode. But there are ways to do quick preview radiosity renders.



OK. You probably want load the Cornell Box project in A:M, go in the Choreography properties pannel, turn ON the Radiosity property and render. I invite to do so and render without multi-pass, with multi-pass set to 1 pass and set to 9 passes to see what you get. I will be back later with more material for this tutorial.

I hope this will be an interactive class type of tutorial so in the meantime, you are invited to post your observations and questions here and I shall answer your questions.

Have fun.


--------------------
Yves Poissant
www.ypoart.com

"In theory, there is no difference between theory and practice. But in practice, there is." -- Jan L. A. van de Snepscheut
Go to the top of the page
 
+Quote Post
ypoissant
post Nov 24 2004, 09:12 PM
Post #2


Master
**********

Group: Hash Fellow
Posts: 2,499
Joined: 18-September 03
From: Québec city, Québec, Canada
Member No.: 70
Programmer: Yes
Contests Won:*



If you did a radiosity render with the default Photon Mapping properties, you should have a result similar to this:
user posted image

Render Times

And if you rendered the scene with Antialiasing (no multipass) or multipass with 1 pass or multipass with 9 passes, you got basicaly the same result. But the exercise was not futile. There is one important concept that is demonstrated with this exercise. On my computer, the render times were almost the same for all type of render:

10m35s for antialiasing render
06m33s for one pass render
10m55s for 9 passes render

You may have expectred the 9 passes render to take approximately 9 times longer than the one pass render. But for Photon Mapping, this is not the case. For the Photon Mapping rendering engine, the most time and CPU consuming step is the Final Gathering step. And the time it takes is directly influenced by the number of Final Gathering samples. However, the Final Gathering samples are distributed among the passes. So when rendering only one pass, the final gathering need to sample all the 150 samples per pixel while when rendering 9 passes, each pass samples only 150/9 = 17 samples per pass.

So because of that, when you use Photon Mapping, you don't have to worry about using multipass. This will not have a huge impact on render time.

Getting the radiosity render right

The radiosity default settings are rarely appropriate for a given scene. A noisy render like that is indicative that there either is not enough photons in the scene or the Sample Area is too small. Since this scene is small compared to a normal room size, the noise is not so bad. But for a normal room size, the noise can look really bad.

Since increasing the number of photons in the scene will increase the render time, it is always advisable to try increasing the sample area first.

There are basicaly two ways to find the proper sample area. A visual procedure and a mathematical estimate.

I have implemented the mathematical estimate in an Excel spreadsheet:
user posted image
You may download it here.

So enter the room size whivh is 55x57x55cm and an estimate of additional object surfaces in the room. In the Cornell Box case, the estimate is simple since we know the tall and short blocs sizes which are 34x17x17cm and 17x17x17cm respectively. And since the room itself is missing the front wall, a 55x55cm area is subtracted which gives 443cm additional.

Simply enter the suggested Sample Area value in the property box and rerender at 9 passes. You should get a result similar to this one:
user posted image

Now that you have this Excel utility, you may want to try with lower and higher number of Photons. See how low you can go and still have acceptabe radiosity renders by setting the appropriate sample area. And see how the number of photons in a scene affects the render time.

Next time I will review the visual procedure for determining the appropriate sample area. This procedure can be usefull for situations where it is difficult to measure or even estimate the total surface areas in the scene.

Have fun.


--------------------
Yves Poissant
www.ypoart.com

"In theory, there is no difference between theory and practice. But in practice, there is." -- Jan L. A. van de Snepscheut
Go to the top of the page
 
+Quote Post
Reikster
post Nov 25 2004, 03:07 PM
Post #3


The Flying Animator
**********

Group: Contributor
Posts: 300
Joined: 29-November 03
Member No.: 1,183



Sorry Yves, It had to be done wink.gif

BTW, does motion blur work with Radiosity?

eric
Attached File(s)
Attached File  cornell_thom.jpg ( 21.28k ) Number of downloads: 183
 
Go to the top of the page
 
+Quote Post
ypoissant
post Nov 25 2004, 03:18 PM
Post #4


Master
**********

Group: Hash Fellow
Posts: 2,499
Joined: 18-September 03
From: Québec city, Québec, Canada
Member No.: 70
Programmer: Yes
Contests Won:*



QUOTE (Reikster @ Nov 25 2004, 07:07 PM)
BTW, does motion blur work with Radiosity?

Yes. And I would add, that since Radiosity is distributed among passes and motion blur benefits from using multipass, then this could be a bonus.

Nice creative use of the Cornell box you did biggrin.gif .


--------------------
Yves Poissant
www.ypoart.com

"In theory, there is no difference between theory and practice. But in practice, there is." -- Jan L. A. van de Snepscheut
Go to the top of the page
 
+Quote Post
Ernesto Esteso
post Nov 26 2004, 11:32 AM
Post #5


Apprentice
**

Group: Contributor
Posts: 27
Joined: 20-September 03
From: Spain
Member No.: 251



Hi! I'm new with the lighting process, and especially with radiosity in A:M (I never use it tongue.gif ) So I'm very excited to read all the information you can bring us ypoissant, and of course all the tutorials you can make laugh.gif

Well, I made the render for this test scene, and the render times is about 25 minutes (well, I haven't a very powerful computer)

Then, I wanna try to do a little animation with the same scene and see how works radiosity. Then I animated 21 frames of a bouncing ball, and the render time was about 3h. 16 minutes at a resolution of 320x240.

But the problem I see is that the light or the image is constant flickering. This is normal with radiosity? Somebody has tried to make an animation?

I put "on" the multipass to 16 passes and motion blur to 40%

Cheers.
Attached File(s)
Attached File  Ball.mov ( 156.48k ) Number of downloads: 485
 


--------------------
Go to the top of the page
 
+Quote Post
MATrickz
post Nov 26 2004, 11:41 AM
Post #6


(Fire Eye)
**********

Group: Contributor
Posts: 478
Joined: 18-May 04
From: Florida
Member No.: 3,015



Awesome animation!! I havent seen anyone do an animation with radiosity yet, and it looks so realistic. I'm not sure why its flickering, but that looked great!!! smile.gif


--------------------
Go to the top of the page
 
+Quote Post
Dagooos
post Nov 26 2004, 12:12 PM
Post #7


Master
**********

Group: Hash Fellow
Posts: 579
Joined: 18-September 03
From: Oswego, NY
Member No.: 60
Contests Won:*



Hi Yves,

I was just curious to why the cornell box only has 3 walls? (besides for camera).
If I,m understanding this correctly(photons are shot from light and bounce around room) its seems like a lot of the photons would be lost
(escaping the room)

Which brings me to my next question how long do photons bounce around? Does each one bounce around the scene hundreds or thousands of times.

Would you be able to use a substantially lower number of photons in a closed environment to achieve same results?


--------------------
"The fact that an animator with a good artistic eye, or a good feeling for motion is able to precisely direct this unbelievable concert of calculations without thinking about a single equation themselves is really quite brilliant."
Richard Harrowell
Go to the top of the page
 
+Quote Post
MATrickz
post Nov 26 2004, 12:21 PM
Post #8


(Fire Eye)
**********

Group: Contributor
Posts: 478
Joined: 18-May 04
From: Florida
Member No.: 3,015



I think you set the number of times they bounce around. Default is like 15 bounces.


--------------------
Go to the top of the page
 
+Quote Post
MATrickz
post Nov 26 2004, 12:29 PM
Post #9


(Fire Eye)
**********

Group: Contributor
Posts: 478
Joined: 18-May 04
From: Florida
Member No.: 3,015



Render Time: around 20 min.

The black thing is like.... a ghost thing wink.gif

user posted image


--------------------
Go to the top of the page
 
+Quote Post
higginsdj
post Nov 26 2004, 04:23 PM
Post #10


2 Subscriptions and CD
**********

Group: Film
Posts: 3,394
Joined: 4-October 03
From: Canberra, Australia
Member No.: 531



Ummmmm. How/where do I select radiosity render and photon map settings? (I must be blind - using v10.5r, 11.0t or 11.1)

Cheers


--------------------
D a v i d H i g g i n s
Canberra, Australia
My 3D Animation and Astronomy Site
My Movie Blog
Go to the top of the page
 
+Quote Post
higginsdj
post Nov 26 2004, 04:32 PM
Post #11


2 Subscriptions and CD
**********

Group: Film
Posts: 3,394
Joined: 4-October 03
From: Canberra, Australia
Member No.: 531



Never mind... Found it in the online tech Reference. I have Will Suttons v11 Tech Ref but the index really sucks!

Cheers


--------------------
D a v i d H i g g i n s
Canberra, Australia
My 3D Animation and Astronomy Site
My Movie Blog
Go to the top of the page
 
+Quote Post
Dagooos
post Nov 27 2004, 06:12 AM
Post #12


Master
**********

Group: Hash Fellow
Posts: 579
Joined: 18-September 03
From: Oswego, NY
Member No.: 60
Contests Won:*



Thanks MATrickz,

For some reason, I was thinking you could not control the number of bounces wacko.gif


--------------------
"The fact that an animator with a good artistic eye, or a good feeling for motion is able to precisely direct this unbelievable concert of calculations without thinking about a single equation themselves is really quite brilliant."
Richard Harrowell
Go to the top of the page
 
+Quote Post
jesshmusic
post Nov 27 2004, 10:04 AM
Post #13


Maestro!!!!
**********

Group: Contributor
Posts: 436
Joined: 15-June 04
From: Portland, TN
Member No.: 3,269



QUOTE (Ernesto Esteso @ Nov 26 2004, 01:32 PM)
Hi! I'm new with the lighting process, and especially with radiosity in A:M (I never use it tongue.gif ) So I'm very excited to read all the information you can bring us ypoissant, and of course all the tutorials you can make laugh.gif

Well, I made the render for this test scene, and the render times is about 25 minutes (well, I haven't a very powerful computer)

Then, I wanna try to do a little animation with the same scene and see how works radiosity. Then I animated 21 frames of a bouncing ball, and the render time was about 3h. 16 minutes at a resolution of 320x240.

But the problem I see is that the light or the image is constant flickering. This is normal with radiosity? Somebody has tried to make an animation?

I put "on" the multipass to 16 passes and motion blur to 40%

Cheers.

It seems to me that the light flickers when the ball passes in front of it. wink.gif


--------------------
Jess Hendricks

Fupduck Productions
Go to the top of the page
 
+Quote Post
robcat2075
post Nov 27 2004, 12:10 PM
Post #14


garçon triste
**********

Group: Hash Fellow
Posts: 11,267
Joined: 5-October 03
From: Dallas, Texas
Member No.: 544



My old Cornell Box in Brooklyn was bigger, but this one has a view of the river and the rent is only $800 more a month.

user posted image

Render time 31 min.

My Q's:

-AFAIK, I did this with the default settings but it didn't come out nearly as "spotty" as the "default" setting render near the top of this thread. Likewise with the unmodified Box project with no character in it. So what changed?

edit:It seems that the sample project already has 750 set for the "sample area" which is the number the calculator suggested. So... the "Spotty" render above must have had a much smaller number?

-Would more RAM help these renders, or do they use pretty much the same as regular renders?


--------------------
Robert Holmén
------
this is only a ... my gallery of A:M tests

49,982 pushed!: the #1 heavy push on Youtube

I'm a 2D wannabe: just skip it!

my screencam tuts All my most beloved tutorials in one convenient location. Except for the ones I've forgotten about.

I solved your problem? buy me something (used is ok!) Big thanks to: dblhelix (twice!), jason1025, Luuk Steitner, PDM, Rob_T and Dhar!
Go to the top of the page
 
+Quote Post
yoda64
post Nov 28 2004, 01:48 AM
Post #15


Master
**********

Group: Hash Fellow
Posts: 575
Joined: 20-September 03
From: Goeppingen,Germany
Member No.: 218
Programmer: Yes



I think , you should increase the sample area, because the value for your additional surface is larger as in the sample project.
The calculation for the additional surface is only easy in the sample project, in your case is it not easy , while first you must calculate the surface for all objects in the box, then you must substract the surface , that is in contact with the roomsurface (doubled , objectsurface and roomsurface). In the sample project this are the bottom surfaces from the two boxes .
For the sample project the calculation for the additional surface is as follow
Box1 34x17x17
CODE
Ao = 2*(h*l+h*b+l*b) = 2*(34*17+34*17+17*17) = 2890

Now substract the bottom surface double (because this is the area where the photons cannot hit)
CODE
Abox1 = Ao-2*l*b = 2890-2*17*17 = 2312

Box2 17x17x17
same calculation as above
Abox2 = 1156
The open front from the cornell box
CODE
Afront = b*h = 55*55 = 3025

The additional surface now is
CODE
A = Abox1+Abox2-Afront = 443


Kind Regards
Steffen


--------------------
Kind Regards
Steffen

http://www.sgross.com/plugins/
Go to the top of the page
 
+Quote Post

5 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 2nd September 2010 - 06:23 AM