PDA

View Full Version : z Depth as greyscale image


brueghel
08-22-2009, 12:14 PM
Hello,

I want to render Z-depth and use it for fog, Ive never done this before. Im using maya and combustion for comp.

I have several render layers of my objects. IIn another layer I want to have a simple greyscale rgb - no special Zdepth info ! Because I want to invert the images and multiply it over the other layers in combustion to achieve white or colored fog.

Is there a way to render this as a greyscale image sequence?
And I dont wanto render all the other objects and lights etc. because I already have them in my render layers just want to have one single greyscale image.


I hope you know what I mean, thanks.

Galakgorr
08-25-2009, 06:39 PM
there's a few different ways to get a depth pass in RGB.

easiest way, if you have mental ray, is to use puppet's p_z shader. http://www.puppet.tfdv.com/download/shaders_p_e.shtml

if you have to use software, you'd use the samplerInfo utility to create a depth shader. connect samplerInfo.pointCameraZ to the inputZ of a setRange utility. set the minZ to 0 and maxZ to 1. then connect setRange.outputZ to the vCoord of a ramp texture. the ramp should go from black to white. finally, connect the outColor of the ramp to the outColor of a surface shader.

the oldMinZ and oldMaxZ of your setRange utility become the overall depth range that you want to use. for example, if you want the near point (white) of your Z pass to be 10 units, and the farthest point (black) to be at 1000 units, set oldMinZ to 10 and oldMaxZ to 1000.

assign the new surface shader to everything and you have a Z pass.

CGTalk Moderation
08-25-2009, 06:39 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.