Feedback

What's your question?

By: [ Editor ] Asked

Rendering a usable Z buffer and using it in comp

Hi,

I'm looking for the holy grail of using depth passes in compositing. Is it technically possible outputting a depth pass that is usable in comp without outputting per-sample data from the renderer (and tweak the hell out of it in comp)? Handling antialiasing, filtering, motion blur and transparency?

Can a "deep shadow map"-like solution work in composite for color corrections, filters and defocus? Is it possible compositing these images (or datafiles) without issues? Can they be precise enough to be used as depth based mattes in particle / volume rendering?

I know these are at least four questions, but hey, I'm up to the great question badge. :)

Cheers, Szabolcs

Add comment viewed 539 times Latest activity 11 months ago

or Cancel

2 answers

  • 3

sam hodge

Accumlating opacity requires the use of a map that doesnt just have the opacity value as a single value per pixel as a single float. As in the old RGBAZ approach.

The opacity needs to be as a value for each depth so if you have 20 overlapping hairs each with 0.01 opacity, the opacity at each depth needs to be recorded. Rather than accumlating it and scoring it as a sum total of 0.2

But the subpixel hair is also where it falls down, because you cannot split the pixel the edge artifacts will be prevlant. Because the original hair is less than a pixel in screen space you cant really have the information before pixel sampling in the deep opacity buffer.

So using a deep opacity map with 3 floats (RGB per depth) as a sampled over depth will work for most things, but will falldown at subpixel sampling for depth resolving.

Motion Blur : YES , Transperancy : YES, Antialiasing : YES, Sub pixel Filtering : NO

If deep opacity maps were not accurate enough to use for particle effects how do you thing they would use them for shadows?

imho

Sam

NN comments
szabolcs
-

Thanks for the answer Sam! So you propose using a map that stores all depth samples for a pixel. And how do you mix the sub-pixel samples to become a single pixel? Simply add them together and drop the close ones? Or do pixel-center-distance based weighting? And how do you mix samples when dealing with the motion blur of an opaque object? Do you use time as a factor too for compositing the samples? Cheers, Szabolcs

sam hodge
-

there are no subpixel samples, just a continuous function that describes the opacity at each depth sample as a colour.

The motion blur is baked into the 3d render, so when combining two motion blurred images you simply accumulate all of the opacities up within the depth samples and that is the value for the opacity at that pixel, then you can know the rgb value and the opacity value and set a final value.

Where it doesnt work is where the RGB are effected by the opacity in the initial render.

sam hodge
-

If you stored the samples and not the pixels basically you would be looking up a point cloud of all the samples rather than a deep opacity map, deep opacities are still raster based.

or Cancel
  • 0

wrosecrans

In theory, a Deep Shadow Map style approach could be useful. I guess you'd need a "Deep Color Map" which stores not only multiple depth values but also the color values at the depths, to really get much benefit. Some operations like Z-Compose would be weird with a set of DCM's, but I guess they should work. Trying to define exactly how you would do keying based on depth for things like selective color corrections is something I can't quite imagine. One of the nice things about a normal Z-buffer is that your normal image operations will work with it. As soon as you are trying to work with a DSM style multisampled image, most of your favorite nodes like a simple Lumakey suddenly don't work, or at best treat it as a normal image, and throw away all the interesting parts.

or Cancel