PDA

View Full Version : lens shader ordering


djx
10-02-2007, 01:40 AM
I have been experimenting with using the mia_lens_bokeh shader in conjunction with the mia_exposure_simple shader.

The attribute editor looks like this:
http://www.djx.com.au/cgtalk/bokeh/cameraAttrSnap.jpg

Does anyone know what order is used when processing the image?
In this example is the bokeh first or last in the chain?

Here are some test renders.
First is just exposure...
http://www.djx.com.au/cgtalk/bokeh/exposureOnly.jpg

Next is with bokeh in the order shown in the attr snapshot...
http://www.djx.com.au/cgtalk/bokeh/exposure1_bokeh0.jpg

And this next one is the other way around...
http://www.djx.com.au/cgtalk/bokeh/exposure0_bokeh1.jpg

I think the last one looks nicer (ignoring the low sampling of course).
What do you think?

-- David

Sorath
10-02-2007, 09:58 AM
hey dude, ..i don't see a difference in the last two images!

sixbysixx
10-02-2007, 10:52 AM
Does anyone know what order is used when processing the image?
In this example is the bokeh first or last in the chain?



I think in this case the difference is very subtle indeed.
I you want to find out the order I would render some chrome materials (or something like that) where you have some proper burned out areas.
Then you could tell by the look of the render if they are first crushed by the tonemapper and then blurred or first blurred and then crushed(Edit: and this would be the physically correct way: first blur, then tonemap). (at least that's my guess;-)

djx
10-02-2007, 11:01 AM
The difference is more obvious when you switch quickly in the renderview window.

What I notice is that the blurred result seems to be dirtier in the middle image. It is brighter and cleaner in the last image. Have a look at the distant objects - in the last image they are noticeably brighter.

I think that with a real lens, the highlights tend to get brighter due to the dof blur. Im not saying one of these images is right or wrong, but I'm interested in understanding the way the two lens shaders are being combined. And in the spirit of trying to be physically correct I wondered if one ordering was theoretically right than the other.

edit: sixbysix, I didnt see you post until now. I will try your suggestion next chance I get.

-- David

djx
10-03-2007, 12:36 AM
Here are two more renders with higher contrast and brighter highlights.
http://www.djx.com.au/cgtalk/bokeh/exposure1_bokeh0_B.jpg

http://www.djx.com.au/cgtalk/bokeh/exposure0_bokeh1_B.jpg

In the first image I think that the exposure is being applied before the bokeh and so the sharper highlights are reduced and get lost in the blur. In the second image the blur happens first, in high dynamic range, before the exposure adjustment and so the highlights have a much greater effect on the blur. The second one looks more like I would expect from reality.

So I am concluding that the order of the lens shaders is starting at the bottom of the camera attribute editor lens shader list and ending at the top.

(Or, if you are referring to the attribute names, cameraShape1.miLensShaderList[1] comes before cameraShape1.miLensShaderList[0])

-- David

achoury
10-03-2007, 12:57 AM
I have been experimenting with using the mia_lens_bokeh shader in conjunction with the mia_exposure_simple shader.

The attribute editor looks like this:
http://www.djx.com.au/cgtalk/bokeh/cameraAttrSnap.jpg

Does anyone know what order is used when processing the image?
In this example is the bokeh first or last in the chain?

Here are some test renders.
First is just exposure...
http://www.djx.com.au/cgtalk/bokeh/exposureOnly.jpg

Next is with bokeh in the order shown in the attr snapshot...
http://www.djx.com.au/cgtalk/bokeh/exposure1_bokeh0.jpg

And this next one is the other way around...
http://www.djx.com.au/cgtalk/bokeh/exposure0_bokeh1.jpg

I think the last one looks nicer (ignoring the low sampling of course).
What do you think?

-- David

hi
I do not understand why you don't plug mis_exposure_simple directly in Lens Shader Slot and keep only mia_lens_bokeh, for the depth!
rachid

djx
10-03-2007, 03:39 AM
rachid, for my experiments I was reordering the shaders alot and that was easier to do using the arrowhead buttons on the right, but it wouldnt work if I used the primary lens shader slot.

But now that I know the order, I will probably just do as you say, since that's where the exposure is placed when you create mia_physicalsky.

-- David

MasterZap
10-03-2007, 12:24 PM
Crush-then-Blur gives you less noise much easier. Most run-of-the-mill DOF would probably be done that way.

Blur-then-Crush gets you the "most accurate" result, and if you really want to "bring out" Bokeh artifacts like done in the images in the docs (the little hexagon DOF effect) you must do Blur-then-Crush, but you'll need plenty samples.

http://i51.photobucket.com/albums/f366/MasterZap/dof-6blade.jpg

Also, ditch that crummy "simple" exposure shader. mia_exposure_photographic, baby ;)

If you are confused by the "photographic" terms and just want to use a traditional "gain" (multiplier), just set the film_iso to zero, then the "cm2_factor" is just a gain, so you can just copy the value from your old "simple" to the new "photographic".

Then you can add some nice Vignetting (should be at least 1.0, I tend to use 3)

The "vignetting" of 1 means the intensity is proportional to the cosine of the angle of the ray to the film plane, which physics pretty much dictates would be the minimum real world attenuation at image edges. A higher value makes them darker (for the curious: it's actually the exponent of the cosine, i.e. "3" means cosined-to-the-third-power)

/Z

CGTalk Moderation
10-03-2007, 12:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.