How do you use the Ray Trace shading vop? Cf is always black.

   1668   3   0
User Avatar
Member
58 posts
Joined: July 2013
Offline
I am trying to figure out a way to get a way to uniquely identify an object inside of a shader vop.
I want to jitter the incident ray and see if it hits the same object each time. Right now I can only use the ray trace vop to see if the ray hits something by checking if the Of/Alpha are > 0. But every time the Cf value is 0,0,0.
I was thinking of having a unique color for each object and just using that as the comparison for the shader, but no matter how I set Cd/Cf values (including doing this operation in an atmosphere shader with Const shaders on all of the objects), the color value from Raytrace is always black.
User Avatar
Member
39 posts
Joined: July 2013
Offline
Hi James,

The Intersect VOP may be able to help you out, one of the outputs is the primnum that it hits, plug that into an import prim attribute vop and you should be able to grab the colour (as long as it's a prim attribute).
User Avatar
Member
58 posts
Joined: July 2013
Offline
Sean Rowe
Hi James,

The Intersect VOP may be able to help you out, one of the outputs is the primnum that it hits, plug that into an import prim attribute vop and you should be able to grab the colour (as long as it's a prim attribute).

The issue I'm having with intersect is that it requires a file name and primitive group.
How do you supply the geometry as the currently evaluated object by the shader?
User Avatar
Member
39 posts
Joined: July 2013
Offline
You could try the op operator: https://www.sidefx.com/docs/houdini/io/op_syntax [sidefx.com]
  • Quick Links