Z-Depth in scene?

   6114   8   0
User Avatar
Member
33 posts
Joined: Aug. 2008
Offline
I might be incredibly stupid, but I'll ask nevertheless..

I work with 3D displays, and one of the things needed is a z-depth image (Of the exact same scene as I'm rendering with materials)
And I'm wondering how to go about that..

No shadows, just a gradient across the scene relative to the camera that uses a grey color to specify depth.

The reason is that the 3D displays need the depth information to be able to give the proper output.

(And yes, it's for personal projects. Nothing beats seeing your own work in fullblown 3D on an actual 3D display!)
New Reality Company
Stereoscopic displays, software, solutions, products.
User Avatar
Member
401 posts
Joined:
Offline
One approach would be to to tell mantra to write an additional image plane holding this information.
See the output tab of /out/mantra1 in the attached file.

The plane will be selectable in the dropdown menu of mplay … the one that reads
“C” by default …

Attachments:
setup_pz_imageplane.hip (79.2 KB)

this is not a science fair.
User Avatar
Member
33 posts
Joined: Aug. 2008
Offline
Thank you so much!

The only thing I'm trying to figure out is how to invert the range (So that bright=closest)
-edit-
I just tried setting the gain to -1, which seems to work except that that turns the background all white, any ideas on how to set it up so that what's furthest away is black, and closest is white. (Without what I just tried)
New Reality Company
Stereoscopic displays, software, solutions, products.
User Avatar
Member
401 posts
Joined:
Offline
Pz is not normalized as far as I know - therefore @inverting@ might not be as straight forward as one expect.

Here is an example shader that does some normalized/clamped depth stuff:
http://forums.odforce.net/index.php?s=&showtopic=6967&view=findpost&p=53527 [forums.odforce.net]

I guess the easiest way without writing a shader is to solve this in post.
this is not a science fair.
User Avatar
Member
33 posts
Joined: Aug. 2008
Offline
I guess I can do that.
Next stupid question; When rendering to mplay, I can see the Px layer, but when I try to save that as a separate image all I get is a black image. Not the same as I see in the preview. Ideas?
New Reality Company
Stereoscopic displays, software, solutions, products.
User Avatar
Member
33 posts
Joined: Aug. 2008
Offline
Any ideas rdg, on what I'm doing wrong or how I can save the Pz image to disk?.
Right now like I said, all I'm getting is an all black image, nothing like the one I see in the preview.
(I've also tried setting the channels to Pz for export, and thus ending up with the all black image)
New Reality Company
Stereoscopic displays, software, solutions, products.
User Avatar
Member
401 posts
Joined:
Offline
without a scene it's hard to comment.
I set the plane to write into an image like foo_pz.png and it looked like the channel in mplay …
this is not a science fair.
User Avatar
Member
33 posts
Joined: Aug. 2008
Offline
I'll post a scene later on, right now I'm tied up with a rendering.
I tried the scene you posted, rendered into mplay, and could switch between the normal image and the Pz one.

I could save the normal one of course, just Save Frame.
But when I tried with the Pz one, I got an all black image.
(I tried setting it to save the image using the Pz in that save-menu as well)

As you probably can tell, I'm not very used to Houdini and maybe this is a very simple thing to fix, I just don't know how
Sorry for all the questions, but thank you so much for answering
New Reality Company
Stereoscopic displays, software, solutions, products.
User Avatar
Member
10 posts
Joined: March 2009
Offline
im getting the same thing. trying to get just the greyscale depth image that im viewing in mplay from the .rat file , but saving it from mplay creates the black image.

did you find a solution?

-Will
  • Quick Links