PDA

View Full Version : whats equivalent to sampleInfo node in MR?


Firas
02-13-2005, 08:42 AM
hi people,

i have an asbtract 3d environment, and am using Deapth material using sampleInfo node :


float $depth=100; //depth from camera
float $distance=sqrt(pow(samplerInfo1.pointCameraX,2)+pow(samplerInfo1.pointCameraY,2)+pow(samplerInfo1.pointCameraZ,2))/$depth;
$distance=1-$distance;

//output
Red_channel=$distance;
Green_channel=$distance;
Blue_channel=$distance;



it works fine in maya software render .. but not on MENTAL RAY !
in another way.. how to render the zdepth as RBG on mentalRay ? (this is not my goal, but will solve my problem)

can anyone help me in that,please

lazzhar
02-13-2005, 09:23 AM
Hi Firas, That Maya shader won't work in MR.
Rendering z-depth with MR is ,likely one of things that I still bearing with even though it's easy to reuse the z-depth channel in most post production programs such as Combustion and Photoshop.
It's always possible to use the old school way to render zdepth by just adding a envirement fog to the whole scene and give everything a while shader. It gives a better results than anyother way I ever used.. well with the cost of rendering time of course.
It would be nice if we can find any MR shader rendering just the zdepth.
Wish good luck for you.

Edit:
I think I need a wake call and go start browsing highend3d as the old days.
http://www.highend3d.com/files/dl.3d?group=melscripts&file_loc=zdepth-v1.0-.mel&file_id=2927
A shader working with both MR and Maya soft.. didnt try it yet of though.

Firas
02-13-2005, 10:14 AM
thankx for reply :)

as i said z-buffer is not my target .. am doing a shader were its important to know the distance from camera .. and as i said it works on maya software render .. but not mental ray .. i tried to track the problem .. it may be the compatability of sampleInfo node .

cryolab
02-13-2005, 10:55 AM
moin,
it can be done with a light info node and a driven key from lightinfo to whatever u will try

heres n xample with a blend color samples the distance from a perspShape
http://www.germanseticommanders.homedns.org/3dluvr/mr_depth_shader_temp/

Firas
02-13-2005, 12:16 PM
cryolab, u are the man .. it works 100% ..

i didnt know that lightInfo node has distance output.. and by the way i love the nodes output because its realtime feedback ..

big thankx:thumbsup:.

Firas.

azshall
07-20-2005, 03:21 PM
Hi guys, I know this thread is a bit old, however... The website above is down and I'm needing to do something like this without having to use any proprietary shaders. It seems as if this setup is doing just that... Any help?

az

CGTalk Moderation
07-20-2005, 03:21 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.