PDA

View Full Version : Z-depth and displacemen


Shaolee
11-14-2009, 06:43 PM
Is there anyone who know how to render a floating point z-depth pass, that has a displaement map asigned to it's geometry?

I have tried it the Maya software way- right click the renderlayer- click attributes- go to presets and luminance deapth

I have tried it through the new passes in mental ray.

What am I doing wrong?

daddyo
11-15-2009, 04:00 AM
what do you mean by floating point?

sean3dmonkey
11-15-2009, 06:23 AM
Yes, I would like to know how to do this,too. I make 5 sphere and space them apart. Assign them to a render layer. Then, Right click and select attributes. From the presets, I choose Luminence depth. Make sure Mental ray is turned on. I get a render that looks like the alpha channel image; solid white spheres against black.

Sean

phix314
11-15-2009, 07:54 AM
what do you mean by floating point?

I would assume 32 bit.

Seems to work for me.

3 nurbs spheres with just a noise node in the displacement slot, framebuffer 4x16, img type hdr. Camera depth pass associated to master layer. Adjustment to exposure in CS3 shows detail, but not a ton, in the higher/lower values.

tkdmatt
11-15-2009, 08:11 AM
Yes, I would like to know how to do this,too. I make 5 sphere and space them apart. Assign them to a render layer. Then, Right click and select attributes. From the presets, I choose Luminence depth. Make sure Mental ray is turned on. I get a render that looks like the alpha channel image; solid white spheres against black.

Sean
This would be because your clipping planes aren't set properly, you haven't set the right distance in other words. I think the shader attaches the min and max properties to your camera (haven't got Maya in front of me so this won't be accurate), you can set or camera's clipping planes or break the connections on the min/max values and set them manually. Graph out the shader in the hypershade and you should get an understanding of how this is hooked up.

To do this with displacement I would create the Luminence Depth render layer preset, but change to Mental Ray, and remove the shader override, then apply the depth shader back to your objects, and a duplicate of that shader with the displacement in the shader group to your objects that require it.

If you're using the Mental Ray framerbuffer passes I think you can set the planes if you check the attribute editor of the pass.

sean3dmonkey
11-15-2009, 07:09 PM
Cool, thanks for the reply. I don't think I understood the instructions. Let tell you what I'm doing.

01. made spheres
02. assigned to render layer
03. set preset to Luminance Depth
04. measures the distance from the persp camera to the last sphere
05. selected persp camera typed in distance into the far clipping plane.
06. selected Mental Ray, and rendered.

I still got the alpha channel looking render. So, I tried another way.

Repeated steps 1-4
05. opened hypershade, and selected the surface sample shader and graphed it.
06. selected set range node and typed in the distance.

Could there also be a z depth check box I need to turn on somewhere?

Still got the Alpha channel looking render

Sean

tkdmatt
11-15-2009, 08:08 PM
Cool, thanks for the reply. I don't think I understood the instructions. Let tell you what I'm doing.

01. made spheres
02. assigned to render layer
03. set preset to Luminance Depth
04. measures the distance from the persp camera to the last sphere
05. selected persp camera typed in distance into the far clipping plane.
06. selected Mental Ray, and rendered.

I still got the alpha channel looking render. So, I tried another way.

Repeated steps 1-4
05. opened hypershade, and selected the surface sample shader and graphed it.
06. selected set range node and typed in the distance.

Could there also be a z depth check box I need to turn on somewhere?

Still got the Alpha channel looking render

Sean
Something that helps, turn on Object details.
[Display]->[Heads up display]->[Object details].
Select your furthermost sphere to find it's distance from Camera. I repeated your process and in my case the distance was around 300.
On the Set Range node I broke the connection under Old Max manually changed it to 300. Worked perfect. This also worked with the Far Clip on the camera.

Attached is a simple scene with my example.

sean3dmonkey
11-18-2009, 03:45 AM
Ha ha, great it worked, Thanks a lot. :)

This forum string started off with a question form Shaolee.

"Is there anyone who know how to render a floating point z-depth pass, that has a displaement map asigned to it's geometry?"

Is it possible to render Z depth maps with a normal map or bump map? Wher e would you plug in the displacment map in the surface shader to do a Z depth map render?

Sean

InfernalDarkness
11-18-2009, 05:23 AM
I'm curious to know how or if this is possible as well.

As a workaround, for displacement maps, once could always convert to polys. But that's a hefty workaround, and defeats the purpose for displacement maps in the first place...

If it's a simple scene, that might help.

tkdmatt
11-18-2009, 06:08 PM
If you check the attached file you'll notice the 3rd sphere back has a checker placed as displacement, check the surface shader applied to that sphere and find the displacement attached to it's shading group.

I don't think you would be able to create a depth pass with bump and normal maps, as they just bend the normals on the object so it receives lighting at different angles, since there is no lighting calculated on a surface shader I don't think it'd work.

Plus I don't think a z-depth with bump would be much use unless you were really close to the object.

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