Jump to content

The Cornell Box Diaries


Marc

Recommended Posts

Good morning all and welcome to the Cornell Box Diaries.

Since I've nothing to do I thought I'd expand my knowledge of render theory and shaders, specifically in regard to photon mapping and GI. I'll be the first to admit that I'm not the most experienced in these matters, so this should be interesting for all to see.

I'm going to try and replicate a series of renders (in mantra) done by the illustrious Henrik Wann Jensen. Since we have all the neccessary bells and whistles in v7, it should be easy right?

Well, lets see.

All these renders will be done with these basic specifications.

Reflect/Refract bounce : 4

Area light : Grid, 16 samples (size 1)

Shaders : Walls, ceiling & floor - clay

Back Sphere - VEX Metal, diffuse(0,0,0), reflect(1,1,1)

Front Sphere - VEX Glass, diffuse(0,0,0), reflect(1,1,1), transmit(1,1,1)

Mantra : 5x5 supersampling

Houdini ver : 7.0.171

Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Day 1 :

post-3-1094839711.jpg post-3-1094839727.jpg

The first image is rendered with default shader settings (as specified above) . Specifically, the IOR in the glass shader is left at it's default of 1.2.

I immediately note a couple of things. Firstly, there is an artifact in the reflection of the chrome sphere (a black circle that shouldn't be there).

Secondly, the glass sphere is not right at all. Added to that, it's alpha is very much not correct. The discussion of what the IOR should be set to has been had, so I modified my parameters (see below). I do still believe that the Alpha is incorrect, regardless.

---------------------------------------------

post-3-1094839853.jpg

In this image, I changed the IOR of the glass to 1/1.2. The glass sphere looks like it might be correct, except for the artifacts. The black reflection artifact is still there.

edit : I attempted to render the glass sphere as prim, poly, mesh, nurbs and bezier. All exhibit artifacts of some sort.

----------------------------------------------

post-3-1094839963.jpg post-3-1094839971.jpg

In these images I moved the sphere's a little to bring it a little closer to the reference images. Notice that the black reflection artifact has disappeared.

If anyone would care to hazard a guess as to why we have these artifacts, then I'd love to hear them.

Here is the file for you to follow the saga along at home:

CB_day1.tar.gz

cornell_day1a_refl_artifact_v1.hip.gz

M

Link to comment
Share on other sites

edit : I've added the refl_artifact file above. I've also submitted a bug for both it and the glass shader.

Diary Update - Day1(a)

Due to the efforts of some fine people (Steven) it has been discovered that the glass shader doesn't like area lights. Making the light into a spotlight returns the expected results.

I will post the fixed images on monday when I get into work (and have time to render them).

That will be day 2, and onto ambient occlusion and photon mapping (can't wait).

Here is the day1a image, no area lights. 1 cone light set to 180 degrees, no soft shadows. I also changed the IOR to 1/1.5 to match closer to the reference images.

post-3-1095091616.jpg

M

Link to comment
Share on other sites

Well; I got around to doing a quick test of this.

It's not so much that the v_glass shader doesn't like area lights, as the fact that the shader has some problems. The artifacts on the glass sphere seem to be coming from the reflection component, but I'm not sure what's causing it: I suspect the in-line eta switch in the fresnel() call, but I'm not sure.

Here's the result with the a VOP shader included in the hip attached below -- using the area light (i.e: it didn't get changed to a spot):

post-148-1095096249.jpg

Concerning the v_blurshadow shader, note that internally, the Oversampling parameter is used as a scaling factor: the base constant is 16 (!) -- this means that if you just want fast shadows, you should set this parameter to zero. Overall; it feels like this is a very old shader, as there's no need to manually jitter rays now: the fastshadow() call allows for non-zero solid angles (i.e: blurred shadows), and the number of samples are now done in Mantra (not as a shader-counter for jittered rays as in this shader). I didn't get to sketch a more up-to-date version with VOPs, but I will when I get a chance. In the meantime, set "Oversampling" and "Softness" to zero, and save yourself a lot of waiting.

One last little thing: what we are used to calling "diffuse" is reflected light -- I know it sounds obvious, but the bit that may not be intuitive is the fact that it should be treated no different than what we call "reflection". The fresnel() function should really be applied to both. Here's what it looks like with fresnel() applied to diffuse as well as reflect/refract:

post-148-1095096264.jpg

And chnging the back wall color so you can see the refraction a little better:

post-148-1095096284.jpg

Obviously, the shadow is wrong (for the glass sphere), and if you use a "filter shadow" type of call, you need to set it indirectly, using the objects Of value which, in turn, affects the way the glass shader evaluates... but that's for another day ;)

Anywhoo... two cents.

Cheers!

P.S: Here's the modified hip:

cornell_day1_mario2.hip.zip

Link to comment
Share on other sites

Hi Mario

That's great, thanks. :)

One question though, shouldn't I be seeing the blue wall refracted in the glass sphere? In my post using the broken glass shader (as well as Henrik Jensen's renders) I see the blue wall refracted.

Using your shader I only start to see the wall refracted if I turn the IOR up to 2...

M

Link to comment
Share on other sites

Ooooops.... yup; that'll learn me! <_<

Yeah; spoke too soon: A changing N (and a constant I) is not enough to flip the result of fresnel as we cross boundaries. So we do need to keep that bit. Appologies :blush:

I'll update my previous post with correct hip+shaders.

Note to self: look at the reference images first! :P

Link to comment
Share on other sites

Day 2:

Well, after the initial tragedy that day1 was turning into it was ultimately saved by the timely and fortuitous intervention of Mario (who has now entered the tale as the hot-blooded latin hero, and is nicely juxtaposed against the comic relief of Jason and Arctor).

So day2's diary entry is all about caustics. Whether they can be done, should be done or are even worth doing at all. I believe that caustics are definitely worth the effort.

So here is the first image using 500 000 photons and Mario's wonderful new (and working) glass shader. You'll notice that it looks slightly different to the reference image. The caustics look slightly different in the center and I'm not getting any bounce on the wall. I'm not too concerned about the shape of the caustics since that could be attributed to a number of things, and besides... it looks pretty.

I followed (mostly) the steps outlined in this video : Caustics

post-3-1095105400.jpg post-3-1095117685.jpg

In the last one I added photons to the chrome sphere too.

post-3-1095121680.jpg post-3-1095121690.jpg

ah yes, here is the hip file : cornell_day2_v1.hip.gz

M

Link to comment
Share on other sites

Day 3 :

Well since day2 went rather well, I've left it at that and moved straight into day 3. If the reference material is to be believed then my render should take somewhere along the lines of 15 seconds to render. According to my mplay window my render started at 11:32 am... it's now 1:56pm PST.

Something, somewhere seems to have gone wrong.

I notice now that I may have used too many photons (100 000 global photons and 500 000 caustic photons), but I'm too far along now to stop.

As soon as the current render is done I will fire off another one with the desired 200 000 global and 50 000 caustic photons.

Image1 : 100 000 global, 500 000 caustic

Image2 : 200 000 global, 50 000 caustic

Both were rendered with a sampling quality of 8, and are pretty noisy. I also realised that I had my irradiance cache set to "write only" and that's why they were so slow. I'm rendering another one now and its going alot faster.

post-3-1095202353.jpg post-3-1095202359.jpg

It's interesting to note the sharpness of the glass caustics in the first render.

M

P.S. I donated blood this morning, so I'm a little woozy and slow today. Day3 may in fact spread out to more than one day.

Link to comment
Share on other sites

According to my mplay window my render started at 11:32 am... it's now 1:56pm PST.

Something, somewhere seems to have gone wrong.

13780[/snapback]

Uh oh :tumbleweed:

Guess that doesn't bode well for the question of "Whether they can be done, should be done or are even worth doing at all"...

If it doesn't turn out to be a simple thing (like just too many photons or something), and caustics are in fact pigs, then maybe it'll be woth looking at what can be done (if anything) by using point clouds; maybe in conjunction with the auto-gen'd photon maps.... just a thought.

But hopefully it's just a bad setting :unsure:

Link to comment
Share on other sites

Forgive me, I wasn't clear. The exceedingly long render times are caused by me hitting the "Full Irradiance" button.

Caustics aren't that long in this controlled test. Longer than the 12 seconds HWJ claims to have made them in, but not long enough to put me off.

Link to comment
Share on other sites

Day 4:

And so we begin day 4 with an interesting turn of events. For some esoteric reason, no matter how hard I tried, I could not get rid of the noise in the render regardless of how high I turned up my irradiance sampling quality. In fact, I could not detect a noticable difference in the prettiness of the render at all... all it did was take longer (8, 64, 128, 256 settings).

So I discussed this with someone here at work (Erich) and was told that you cannot have the full irradiance and photon maps activated in the same shader. Apparently Houdini/mantra doesn't approve of those sort of shenanigans.

Fair enough, thought I, I'll do some testing in this new direction.

With all this in mind, I have a new render on the go using only caustic photons and global photons, no irradiance. I have also turned up the "Global photon sampling" up to a seemingly massive number of 500. Admittedly I have no idea what a good number for this should be, but the default is set to 50, so 500 seems like alot (although we've learnt the folly of paying attention to Houdini's defaults haven't we?)

As soon as the render is done I shall post it here. I'll be following it up with one that only uses full irradiance, and another combining the two using multiple lights/shaders.

Image1 photons only (global/caustic) image2 irradiance only.

post-3-1095271135.jpg post-3-1095279852.jpg

Last one for today. Irradiance and photons, two seperate shaders and lights. Only 16 irradiance samples though, and it took forever.

Mpost-3-1095290283.jpg

Here is the hip file, in case anyone is interested.

cornell_day4_v2.hip.gz

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...