PDA

View Full Version : ZDepth Ydpeth Xdepth


Ptichat
06-12-2010, 12:43 PM
Is anyone of you know how to get a Y and X depth ?
Another question, can it be based on camera and/or world ?

Another question, is anyone know how to do a pass containing Z X Y depth as R G B in a single frame ?

Thanks a lot

irwit
06-12-2010, 01:35 PM
ive never herd of y and x depth, what you use one for ? Seems an odd one as close to the camera the x distance would be a tiny fraction of the total x depth depending on how far into the distance you could see.

berniebernie
06-12-2010, 03:13 PM
Is anyone of you know how to get a Y and X depth ?
Another question, can it be based on camera and/or world ?

Another question, is anyone know how to do a pass containing Z X Y depth as R G B in a single frame ?

Thanks a lot

Manually, you can plug ramp projections (at 90 degree angles) into the R, G, B of a surface shader:

http://mlkdesign.online.fr/dump/3zdepths.jpg

Maya2010 file: http://mlkdesign.online.fr/dump/3cams.rar

render options are set up to be used with a lens plug in (non aliased zdepth)

Ptichat
06-12-2010, 11:54 PM
Irwit, those passes are wonderful when it comes to use them while compositing.

Bernie, I ll give a try but I was more expecting something based on camera as well. Anyway thx !!

irwit
06-13-2010, 12:33 PM
Irwit, those passes are wonderful when it comes to use them while compositing.

Bernie, I ll give a try but I was more expecting something based on camera as well. Anyway thx !!

So what would you use them for ? I've just never herd of them before and wouldn't really know what use they would be ?

Ptichat
06-13-2010, 10:16 PM
If you want to color correct a part of your image, like the right part of the stage.. or just the floor and the first meter above, etc...
Sometime just a part of your image deserve to be grade, rest of it is ok.. So changing the lighting is almost impossible without screwing the part which was well litted.

It is a wonderfull mask !!

DutchDimension
06-13-2010, 11:24 PM
You can do this with the 'samplerInfo' node. It calculates all kinds of useful per pixel values of the image you're rendering. In your case it can calculate the X, Y and Z values for eacht point position in camera space which you can output to a surface shader's RGB inputs.
Don't forget to pipe the output of the 'samplerInfo' node through something like the 'distanceBetween' node and then normalize those values values through a 'setRange' node otherwise it won't work as you might expect.

Ptichat
06-14-2010, 10:15 AM
You can do this with the 'samplerInfo' node. It calculates all kinds of useful per pixel values of the image you're rendering. In your case it can calculate the X, Y and Z values for eacht point position in camera space which you can output to a surface shader's RGB inputs.
Don't forget to pipe the output of the 'samplerInfo' node through something like the 'distanceBetween' node and then normalize those values values through a 'setRange' node otherwise it won't work as you might expect.
Exactly what I need, but couldnt do it...
This sampler info is definitively not my friend...

irwit
06-14-2010, 11:08 AM
If you want to color correct a part of your image, like the right part of the stage.. or just the floor and the first meter above, etc...
Sometime just a part of your image deserve to be grade, rest of it is ok.. So changing the lighting is almost impossible without screwing the part which was well litted.

It is a wonderfull mask !!


Ah ok, that makes sense, if you figure out a shader it would be a nice extra pass to have in comp. I guess anything that saves you rotoing or rendering extra mattes is a good pass to have!

DutchDimension
06-14-2010, 11:37 AM
Your shading network would look something like in the attached picture.
You have one samplerInfo node that outputs pointWorldZ, pointWorldY and pointWorldZ into three individual distance between nodes (into point1Z, point1Y and point1X respectively).
Then you output each distance node's distance value into the setRange node's valueZ, ValueY and ValueX inputs. In the setRange node you set the oldMin/Max values to the bounding values of your scene and have the (new) min/max values set to 0/1 to normalize the values so they can be used visually as RGB values. Then you're ready to plug the setRange outValues into a shading node's RGB values.
Then create a new renderPass and assign it as an override.

Keep in mind that this only works if your scene is aligned positionally from a corner of world space, kinda like a 0-1 tile in the UV editor. If it's centered on the world origin the channels will be split down the middle of your scene and you'll need to add additional nodes to offset the values.

Hope this helps.

Exactly what I need, but couldnt do it...
This sampler info is definitively not my friend...

Ptichat
06-14-2010, 12:33 PM
I give a try,
Thx so much !!

Irwit, yeah have a try, this pass doesn't cost anything to render and is a time saver !

DutchDimension
06-14-2010, 12:51 PM
Excellent! Let us know how you get on. HyperShade's pretty awesome if you know it's powers. :)

Ptichat
06-15-2010, 08:52 AM
Excellent! Let us know how you get on. HyperShade's pretty awesome if you know it's powers. :)

DutchDimension (http://forums.cgsociety.org/member.php?u=394273) you're awesome. Thx a lot it works really well !

DutchDimension
06-15-2010, 09:33 AM
Glad to hear it works. Let the power of compositing commence! :)

DutchDimension (http://forums.cgsociety.org/member.php?u=394273) you're awesome. Thx a lot it works really well !

joie
06-15-2010, 09:55 AM
Most of that sampler info connections aren't supported by mental ray renderer, and that sucks. I tried to make a shader to react based on the distance from the camera, wich worked like a charm in maya software, but not in mental ray at all...

Ptichat
06-15-2010, 10:04 AM
the quick test I did has worked on Maya 2008 MentalRay Linux and batch rendered which produced a nice EXR !

In case of people are going to use that pass, keep in mind grading this in 8 bits is a bad idea :scream:

DutchDimension
06-15-2010, 12:47 PM
Hi joie, you must be doing something wrong then, as I've got a distance from camera shader rendering just nicely with mental ray. And as far as I can tell, all the other samplerInfo outputs work also.
Don't forget to pipe the samplerInfo output through something like a distanceBetween, or plus/minus/average node before you run it through a setRange node and out towards a surface shader.

And Ptichat, yes don't run these passes at 8-bit. 32-bit all the way! :)


Most of that sampler info connections aren't supported by mental ray renderer, and that sucks. I tried to make a shader to react based on the distance from the camera, wich worked like a charm in maya software, but not in mental ray at all...

Ptichat
07-11-2010, 05:30 AM
Is it possible to export value out of the range 0 to 1 ?

DutchDimension
07-11-2010, 08:36 AM
Of course it is. Remember that 'Set Range' node?

Is it possible to export value out of the range 0 to 1 ?

Ptichat
07-11-2010, 11:35 AM
Of course it is. Remember that 'Set Range' node?
I got rid of the range node and re-render using MentalRay.
RGB are still clamped from 0 to 1.

I just gave a try with VRay and it gives me exactly what I wanted, value without limit !!

CGTalk Moderation
07-11-2010, 11:35 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.