How to compose a DoF with zCoverage?


#1

Hi there,

I'm a little bit lost with z-buffers and z-coverages.

Let’s assume we rendered a beauty pass, a correct zdepth pass (non antialiased), a coverage pass and additionally a label pass (I don’t know if it’s really needed though).

Now if I would like to create a nice Depth Blur in Fusion without ugly halo effects and jagged edges, how would I have to compose those passes?

I searched the forums and didn’t find any hints. I tried around myself and didn’t manage to get satisfying results. Can anybody give me a hint?

Thanks a lot in advance ...

#2

hi,

though i have never tried the dof blur eith a z coverage pass I assume i know how it should work :slight_smile:

You have the passes in different images right? if so… load your beaty pass and asign a Channel boolean to it. in that node go to the Aux Channels tab, check Enable extra channels. Connect whether your zdepth or z coverage to the foreground input on the channelboolean. Now you can specify what is being used as z depth (coverage) - > Luminace of foreground… repead those steps forthe second map… than assign de depth blur…

hope that helps


#3

Yes … this is what I am after. I tested your workflow, everything worked fine but it didn’t improve the look of my DoF.

I will describe my dilemma a bit further:

I am trying to achieve a correct depth blur in post. In the image below you can see the undesireable halo effect I get with every zBlur node I tested. Also the area where the frontmost blue sphere overlaps the yellow sphere is not correct.

[img]http://www.tomlippitsch.de/cgtalk/test_dof.jpg[/img]

[img]http://www.tomlippitsch.de/cgtalk/test_nodof.jpg[/img]

Then I heard about zCoverage files, which are supposed to correct those edge artifacts. In the “Common Controls” panel in the “Depth Blur” tool in Fusion there is a function called “Correct Edges”, which appears when you activate either on “Use Object” or “Use Material”.

As far as I know this option works perfectly with the .rpf format used by 3DSMax. But I am sure that there is a possibility to take advantage of this option with Maya.

But I don’t know how to composite all those passes in Fusion to make them work.

Since I have to activate the “Use Material” or “Use Object” before I can activate the “Correct Edges” option, I assume that I need some material or object ID information. I can render a label file in MR, which might be useful for that.

But as you can see … I am lost.

I just would love to have a 2D DoF which is actually useable.


#4

I´m a Max user and I´m having the same problem using the RPF and trying the to make the coverage to work propertly.


#5

can we see the depth pass image please?


#6

Fusion or DF?


#7

A few thoughts,

  1. you can render Coverage out of Maya 7 - Mental Ray with the new multi-pass render settings thing. Two notes: There is a bug in Maya to MR whereby the Coverage Buffer is offsetted by 4 pixels horizontally so you would have to move it to fit so you loose 4 columns of pixels on the left side. You also have to make sure you have at least 4 samples or something when rendering that 2) Coverage coming out of Mental Ray are different then coming out of Max. The Mental Ray coverage is object silhouette only while Max returns interior edges (eg arm over body of same renderNodeId would return a greyscale value at intersection). Spheres would be a case where the results would be the same.

  2. Sometimes you would want one, sometimes the other. Perhaps one can convert Max type Coverage to silhouette-only by chaining a few tools like doing an edge detection on the RenderNodeId channel, removing that edge result from the RenderNodeId cutout, then multiplying the Coverage by the edge image and then adding (Coverage X edge ) to RenderNodeIdCutoutFromWhichEdgeHasBeenSubtracted. (It might be simpler to simple do a few per object renders though).

  3. As well in Max G-Buffers the RPF actually has layers, so where there is not 1.0 (full coverage) on the full layer, there is data on a second layer and so forth. I have not played with FU5 DOF yet so I am unclear how they interpret this internally in a DOF context.

  4. One thing that can help when you break this into 2-3 layers (either simply via z slicing or ObjectId type cutouts) like here treat the big blue sphere as it’s own pass would be to use on the BG something like RE:Fill (http://www.revisionfx.com/rfilgal.htm ) assuming your render is full frame in the end (full on alpha everywhere) to put relevant colors in the hole left by cutting the Big Blue Sphere off the BG.

Pierre


#8

if your gonna use the ‘use material’ or ‘use object’ controls you’ll need a seperate node for each instance you want to use it…it looks like you have 10 balls so you would need 10 nodes unfourtunately, that is probably the case for the correct edges feature as well.


#9

i spoke to eyeon people about this. the correct edges checkbox is only when u are using object or material id. if you have an image with z-buffer and coverage map then the fog node will automatically correct your edges provided your coverage is connected properly to ur image. if you have separate images (beauty pass, z-buffer, coverage) then just use channel booleans. first you can connect beauty pass to background of boolean node then connect z buffer to foreground. enable aux channels support and choose to copy the z info to z buffer. then connect the output of ur channel boolean to the background of another channel boolean. connect the coverage map to the foreground of the new channel boolean and enable aux channel support. then choose to copy coverage to coverage slot and copy z buffer to z buffer again or i think u can leave it to do nothing i forget. then the output of that channel boolean can be connected to watever depth effect you want and the depth node will recognize both z buffer and coverage and will automatically correct your edges. now, if you coverage map sucks ( coverage map might not have the inner edges or watever) then no amount of correction will make ur edges look purty! so make sure ur coverage map has enough samples and it is properly aligned (i noticed that bug where the coverage map is off to one side by a few pixels).

i still find this whole coverage map thing really hard to create and use efficiently. its kinda annoying. if this process isnt working for you then you can do the old timothy albee technique where you render every thing twice as large as u need it without any anti-aliasing(meaning you will render out ur z buffer AND beauty pass twice as large). then u can do all ur depth effects and then use a scale tool to shrink it by 50% so u can get nice edges. thats what i have been using, it works well but ur puter needs to process all those large images so it slows you down. but if coverage aint working for ya thats all you can do to use depth tools. well hope this helps see ya


#10

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.