PDA

View Full Version : Depth of field from max Z depth into combustion??


spikomatix
11-26-2004, 10:28 PM
hello,
i need some advise.
i have bought combustion 3.0 now and have some questions.
the fat red book helps a little but my questions need something like an tutorial..
(excuse my bad english please)
ok..i want do have a depth of field applied to my 3d image..
i want to do this in combustion cause i read its faster then the internal max camera passes..
so i can render it out in rla or whatever (z depth ist stored in it)

how do i use depth of field in combustion?

i always try something like :
-new
-3D composite PalD1
-import footage(rightcklick on my composite)
-import rla
-by rla it askes me nothing.
-by rpf it askes me three options (merged;nested;layers)
iam not sure how to handle it
-now iam completly confused..cause if i add depth of field or gbuffer show to the composite i dont know how to make it visible..i just want to use my z information for the camera..

i want to set the charakter in the middel(max camera focus is there!) sharp and the rest of the scene have to be blurred (forground slighly and background)
but the part the charakter stay have to be sharp area..

so how can i achieve this effect and is it possible that combustion uses the zdepth of each image in an animation?i mean i want the sharp are always on my moving charakter..so it has to be solved over the camera focus from max?

please help me out..iread all proffessionals use this method..

iam trying to get more in combustion..but i hiope for an detailed answer from an advised user.

thank you

spikomatix
11-27-2004, 01:30 AM
ok i got the dof effect after reading it twice in the combustion book..
but now my main problem is that if i export from max in rpf format and apply the dof effect in combustion :

-there are bad edge effects between the seperated layers (in my case some trees)
-the objects dont seem to fit to the whole picture
-it is in "best" view
-it is the same so if i apply a blend filter in max to blur the picture..
-is there an "AA" mode?

-another thing...:

what is if i make an animation in max and import it as multiple *.Rpf files into combustion..what is with the DOF effect..how can i use the internal Max camera in combustion so that the Focus(sharp) area is always there where it was in max?

-Or do i have to adjust the "near" and "far" limits of the Dof effect all the time?(keyframes..)


where the pros at?

interference
11-27-2004, 05:52 PM
hi,
well... i had the same problem as you with rpf/rla, and i choose to use "render elements"
to get a single B&W picture for Z info.
then in combustion, duplicate your layer, blur it as you want, and set alpha with the z sequence to your blured layer.
hope this help ? :)

spikomatix
11-28-2004, 02:00 AM
hi interference,

first ..do you also mean Depth of field?i want to achieve this in combustion over animated footage from max!
iam new to combustion (i just bought it) i have the handbook to check out a lot..but..i didnt figure it out (see for yourself they explain not enough..)

problem is that my english is not the best for this forum...
but i know exactly what you suggest..till the point of:

"duplicate your layer, blur it as you want, and set alpha with the z sequence to your blured layer."

i duplicate my layer thats clear ..

so what do i have to blur?my second (duplicated)final render(diffuse)
which has to ly beneath the untouched layer..?

but what is with the alpha?what do you mean..how does it work?
please give me an deaper explenation..

thank you very much..

i have rendered out a jpeg from my combustion project which shows those bad edge effects..seems like the objekts got an outline or something if i do the stuff in RPF files or rla :-( if you want i can email it?or messenger it..

and also the "gaussian" blur is slow as hell to been shown in the combustion viewports..i cant work with that..
so is there an option to get this fixed or do i have to work with boxblur in DOF?

sdg0919
11-28-2004, 03:36 AM
There are several ways to acheive the effect you are looking for in addition to the one suggested above.

If you have the z-depth as a separate pass you can also try somethine like the attached workspace (see zip file). Where a compound blur was used to select the luminance value of the Z-depth layer. There are a few other operators I placed on the Z layer to give you some ideas of what kinds of things you can do to manipulate the DOF effect.

Although if I am following correctly, it seems that you have an RPF form of the animation. If so, when you import, select merged. Then to that layer apply the 3D post > 3D Depth of Field operator (this assumes you included the Z-depth information during the render). It should be straightforward from there.

Finally, there are some plugins that will easily allow you to setup these effects using the z-depth render pass method (Puffin Image Lounge: True Rack Focus comes to mind).

If what I said isn't clear, feel free to ask for clarification.

Dave

spikomatix
11-28-2004, 12:19 PM
@ dave thank you for helping me..but first i have to tell you that i cant use your file?hich format is it?i have C3.

but you said that:

"Although if I am following correctly, it seems that you have an RPF form of the animation. If so, when you import, select merged. Then to that layer apply the 3D post > 3D Depth of Field operator (this assumes you included the Z-depth information during the render). It should be straightforward from there."

thats all correct and works well but i have this one big problem..
-Gaussian Blur on the Rpf footage is slow as hell
-Box Blur results in bad bad edges to see on most of my objects(seems like an outline)
-(the rpfs iclude ALL max chooseable informations_that seems to be ok?(ieven turned on filtering in max))
-the Boxblur looks like crap!(edges on objects)
-Gaussian Blur takes to much stuff of the image in the depth axis and istn soft blending over multiple objects..

(i select far Plane as Background..and the gaussian takes my charalter in the middle half with it(blurred) and it looks all like cuttet out somehow..it would be great if i could send anyone a picture from it?

sdg0919
11-28-2004, 05:12 PM
Hi spikomatix,

The issue with the edges around your objects is due to anti-aliasing of the image file. If you turn antialiasing off in max and rerender (try a single frame) this hard edge will be reduced.

In general you want anti-aliasing ON. The issue here is that you not only have an alpha channel present (for example if you want to composite your render over some other background), but you are trying to Z-depth information to create the DOF. The issue arrises in that Z-depth is calculated for the actual object as it exists in the scene. Anti-aliasing is a post process that blurs the edges of the forground objects so that hard transistions don't occur in your image.

Regarding box vs. gaussian blurs. Box blurs are always going to be faster because of the nature of the algorithm. The problem is compounded for some reason when you do the operation as a 3D Post effect in Combustion for some reason (I am not sure why this is).

In general whie the RPF format is nice, it isn't a cure all. For the DOF effects, it's often more convenient to use a different approach. Regarding the previous file, I'm not sure why it's not opening (I'm also using C3). I am posting a screen grab of the operator setup so you can try and recreate what I'm talking about.

Let me know if any of this is still unclear,

Dave

spikomatix
11-28-2004, 07:53 PM
hi dave,
1000 thanks for helping iam going to try it right now..just wanted to say that..
i write back soon!


did i understand it right that my Max turned on AA-filter makes my foreground image(diffuse ect.:) in RPF file blurry and cause of that i dont have clear edges?

what do you mean with dat:
The problem is compounded for some reason when you do the operation as a 3D Post effect in Combustion for some reason (I am not sure why this is).

****
-i mean i rightclick my composite and apply this 3d effect "DOF" thats the regular way or not? is there a solution to get this faster?or do i have to use box blur?

-could it be that i stored to much information in the Rpf which i dont need at all for DOF so the gaussian blur slows down due to that?


iam trying to check your stuff out right now to get it fixed..

thank you really for guiding..iam working on an 1 min 3d film so i really need some help here and there

(the MAX dof also with really low settings ..takes way to long..)

spikomatix
11-28-2004, 08:17 PM
hi dave its me again...
iam getting faster..
ok so i rendered out a single image (rpf with all infos in it) but this time i turned OFF the AA filter in max..
i imorted in C3 and applied a DOF on it..it looks a lot better now!
but now i dont have AA! and..here it comes:
my scene contains trees and grass and the grass looks very bad now ;-)

so what is the ordinary way everyone uses to achieve all this stuff?

i think it is important to have the Zdepth in an single image?is that true? so i do have more control over the DOF?

keep in mind iam not doing single frame..

i render 1000s (animations..)

so i need something which supports workflow...

--my main question which i do have in head all the time..
-How is it possible to bind the DOF effect to my camera range?
-i mean what happens when i move camera and charakter throug those trees...
-does my DOF uses the releating Z-depth images which contains the right data?
-it has to be an "animated Dof" ?
-iam little confused-.


thanks a lot..i ll experiment much now..





i still cant open your workspace (it even hasnt a C3 symbol..(could this be cause of pal/ntsc?)not really?

i see your picture..i see you use a compound blur to blur what?the luminance ??of the Diffuse footage?why that?

i see u blur the z-depth--
but i dont know what the CC Histogramm is and what the above Invert does..i ll try to look in help or book..

spikomatix
11-28-2004, 09:27 PM
ok i achieved it to rebuilt exactly what you done..

i used a rpf file with an extra Z image (tif)

i made 2 composites -one with the Z depth and the CC Histogram for adjusting and an invert for the compound blur to choose the background to blur..

the second composite contains the fottage and a compound blur which chooses the Invert layer cause it lies above the cc histogramm and the Z-depth tiff..

this works very very good..

my image looks very good..without edges and stuff..

so i have to check out if this all is working really on animated charakter and changing focus..

its clear that only the darker areas get DOF ed or blurred..the more white an area the less the blur..
thats ok... but if my charakter move in to the background..it will be completly blurred :-(

so is there an option to compansate that?

or do i have to animate the CC HISTOGRAMM?
this would be time consuming but an option...

thanks again dave

sdg0919
11-28-2004, 09:27 PM
"1000 thanks for helping iam going to try it right now..just wanted to say that..
i write back soon!"

You're welcome! It's my pleasure to help.

From what is sounds, I think you are going to need to use the AA.

In general, there usually a lot of different ways to achieve a certain effect. One method won't necessarily work for all situations. Based on what you said, I think a method that doesn't rely on the RPF format might be better.

I'm not certain why the file I posted won't open. Do the following:

In MAX

Render your image and use Render Elements to render the Z-depth as a sepearate image (I usualy use TGA to preserve the alpha, but it another format may be appropriate).

In Combustion

Import the two files.

Apply a compound blur to the image file (the one that you want to view in the final animation).

Select the layer you want to use for the blur information (this is the Z-depth layer). By setting it to luminance, what happens is that the brighter the pixel value is (closer to white) the MORE blurred it will be. The darker the less blurred.

This will cause your forground objects to be more blurry than the background (to reverse this, apply an invert operator to your Z-depth layer, and in the compound blur select that level of the Z-depth layer. That is, you previously selected the base layer in compound blur, to use the Invert you ave to go back and cick the layer button and select the invert operator in the Z-depth stack of the dialog).

If the last paragraph is confusing do the following:

Add a compound blur, click the layer button and select Z-depth.
Add an invert operator to your Z-depth.
Click the layer button on the compound blur again.
Select invert.

It should be obvious then what I was trying to convey...I think.

Depending on the shot I will usually use some variation ofthis method, but usually using Image Lounge's True Rack Focus. But it's more expensive now to buy the suite than it was when I purchased it. In general I think the camera DOF in Max is very good (but as you pointed out it's very slow because of the extra rendering). In addition, doing the DOF in post gives you more freedom to change the DOF effect without having to go back re-rendering.

To answer the portion of your post regarding the animation and Z-depth. If you set up your render so that you do a render elements pass, it will generate a Z-depth image for each frame of the animation. Some things to keep in mind:

1) You may need to make certain that if your camera is moving, the ranges for the Z-depth cover the fill range that you want to blur (the maximum depth).

2) You can alter the Z-depth values later if necessary by applying a Discreet Histogram operator to adjust the levels if necessary.

3) If you plan on changing the DOF during the animation itself you can key the blur levels and hisotgram levels in C3. It can end up being a lot of work, but it will give you a lot of control and generally you can then set the parameters to exactly what you want.

Combustion has a steep learning curve, but it can be well worth it, so stick with it. There is an excellent book that just came out from Focal Press by Gary Davis called "Focal Easy Guide to Discreet combustion 3". It's very good.

Hopefully this cleared up some things if not, feel free to ask for further clarification.

If you have a frame and a Z-depth image for that, and would like to post it to me so I can look at what specifically you are talking about, you can email it to me: david_gohara@hms.harvard.edu


Regards,

Dave

spikomatix
11-28-2004, 10:21 PM
hey dave thaks for typing all that stuff but you already trained me that much to know what its about..

i did it all and worked well..
very good!

so i am not sure if iam going to render all the images as rpf files + all extra Z-Images..

otherwise..so the recder time is very fast..


and i have full controll over everything later on.. :-)

i did the AA on the rpf files..but the Z-Depth i render out in same time but seperated (render elemnts) it worked well so far..


iam asking myself what defines the Z ranges in max?is it the camera?cause the Z-depth layer does not show the full depth of image..
it seems like it only shows 300 units from camera inward the szene..but i need about 500
so ill try the new value..it will surely work :-)

i email you my final test shot cause one rpf is to big to send (9MB)

one question..:

-did i get this correct : the more blurry my Z-depth picture from max is the bader the result in combustion?(cause my compound has probs with the edges of objects?)

sdg0919
11-28-2004, 10:38 PM
iam asking myself what defines the Z ranges in max?is it the camera?cause the Z-depth layer does not show the full depth of image..
it seems like it only shows 300 units from camera inward the szene..but i need about 500
so ill try the new value..it will surely work :-)

When you setup the Z_depth render element there are two spinners that allow you to set the minimum and maximum distances. What I do is in the top viewport draw a line from the camera to the furthest distance that I want included. Look at the length of the line in the modifier panel and set that as the maximum.


one question..:

-did i get this correct : the more blurry my Z-depth picture from max is the bader the result in combustion?(cause my compound has probs with the edges of objects?)
I'm not quite sure that I follow, but the Z-depth shouldn't be blurred out of max. You may need to blur it a bit in combustion take care of aliasing effects. If that's not what you are talking about perhaps you can explain what you did.

Hope that helps,

Dave

spikomatix
11-28-2004, 11:00 PM
hi dave,

cause of the Z-image blurry..
i meant that it does not have to be blurried in max..(i can do that later in C3) but also in combustion if i blur the z-depth image it looks bader cause of the edges(compound blur does not "find" the edges..so the blur is applied away from objects :-)

but i just wanted to say that..
its clear and works well with sharp Z_depth images..
as you can see in you email ;-)

i have to experiemnt here and there a little to get handy with the whole trick..but it works also with gaussian blur very well (compound blur on my Diffuse image)

excellent!

the Z-scan depth in max was no prob i did increase the range to 400 cause this is the end of my forrest..(as you see in attached picture)

with adjusting the CC Histogram in C3 its easy to edit the whole DOF effect...


even if my charakters walk away from the camera i can turn OFF the "INVERT" and the foreground is blurry ;-)

little tricky but it will work like this...i ll test a little if i render an animation..if i see it takes to long i ll make it in max..

so far thank you very much!

CGTalk Moderation
01-20-2006, 01:00 AM
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.