PDA

View Full Version : Super-detailed zdepth using RGB?


jussing
09-20-2006, 02:46 PM
OK, a theoretical discussion here. Don't know if this has already been done, but the idea struck me yesterday, and I haven't heard about it before.

If your scene is large enough, a normal 24-bit z-depth render just isn't enough, cause even with 24 bits, you still only get a grayscale image, which means your zepth image is limited to 256 levels, which isn't very detailed.

Using 32-bit or 64-images I guess would increase this fairly, but I'm just a little bit behind on that development.

So, my big idea is to have a regular zdepth buffer cover the scene, with a RED gradient from front-to-back, and then a 256 times TILED GREEN z-depth buffer. So, for each of the 256 values of the red buffer, you have extra 256 levels of detail in the green buffer. -An increment from 256 to 65536.

Tiling a blue zdepth buffer 65536 times on top of that would give you 16 million levels of detail, rather than the usual 256. That would be pretty cool I think!

Rendering this is easy, but I don't know how to use it in compositing.

Any thoughts on this? Discuss! :)

Cheers,
- Jonas

pgraham
09-20-2006, 04:27 PM
sounds like a useful idea. I usually use a 16-bit Z-fog pass out of maya, and it has plenty of color depth. I also do XYZ passes, where red is X, green is Y, and blue is Z, and each channel is 16 bit.

Your proposed method should be possible in maya using hypershade. However the shader may need to use an expression to do the modulus that will cause the green channel to repeat. As far as compositing, a program such as shake has enough math capability to restore your high-precision image into a floating point grayscale image.

I have a bigger issue with the anti-aliased (and especially blurred) edges of objects in z-fog passes than I do with precision.

beaker
09-20-2006, 07:40 PM
Don't mean to bum you out man, but Zdepth images from most renderers have been 32 bit float for years (15+).

jussing
09-20-2006, 10:07 PM
Don't mean to bum you out man, but Zdepth images from most renderers have been 32 bit float for years (15+).No bumming out, like I said I'm a little behind on that development... ;)

By jove, it seems you're right. If I render a zdepth over a huge area, and level it in After Effects, I get detail I can't get from levelling a screengrab in Photoshop. :)

Whaddya know. Thanks.

- Jonas

beaker
09-20-2006, 11:24 PM
Also remember that a zdepth isn't raster, it's float data. What the compositor show is an graphic representation of the zdepth. Thats why they aren't antialiased.

jussing
09-21-2006, 07:37 AM
Still, if they utilized the three color channels as described, but in a 32 bit image, the detail level woul be enormous. ;)

Cheers,
- Jonas

CGTalk Moderation
09-21-2006, 07:37 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.