getting Pz into a karma shader ?

   734   4   0
User Avatar
Member
9 posts
Joined: Feb. 2014
Offline
hello . i'm trying to rebuild a zdepth shader in karma. in houdini i usually get Pz from the globals node and fit range Pz between minz and maxz to get a value between 0 and 1 into Cd. how can i do that in karma/solaris ?
User Avatar
Member
1680 posts
Joined: March 2009
Offline
Put down a Karma Ray Import VOP and set it to "ray:hitdist", and a mtlx range after that.
Martin Winkler
money man at Alarmstart Germany
User Avatar
Member
8021 posts
Joined: Sept. 2011
Offline
protozoan
Put down a Karma Ray Import VOP and set it to "ray:hitdist", and a mtlx range after that.

Hit distance is the slant distance, which is the length of P - I in a VEX material. For Pz, which is the Z-axis distance, you want "ray:hitPz"

Edit:
Note this only works for Karma CPU, for XPU you're stuck exporting the depth AOV and remapping in post.
Edited by jsmack - June 11, 2024 12:21:03
User Avatar
Member
8753 posts
Joined: July 2007
Offline
having depth in world units and potentially remapping in post is usually more ideal anyway, at least it's more consistent for depth based comp effects like DOF or Fog
since if it's already remapped to 0-1 there is no easy way to know the real depth
Edited by tamte - June 11, 2024 23:23:05
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Staff
521 posts
Joined: May 2019
Offline
jsmack
Note this only works for Karma CPU,

"ray:hitPz" should work with XPU
https://www.sidefx.com/docs/houdini/solaris/karma_xpu.html#summary [www.sidefx.com]

are you finding that it does not?
  • Quick Links