Jump to content

rayhittest - intersections with raycasting


Recommended Posts

I am trying to use rayhittest() in a snippet to test for intersections from a primitive to an arbitrary location. (A camera, a light etc)

I have an example that works in SOPs in my .hip using intersect, however I need something that works at render-time.

I have tried adding a scope to self, however, I am not sure if my syntax is correct. I have something like;

dist = rayhittest(origin, ray, 0.05, 'scope', 'self');

 

If I bind dist to a hard coded value, I can see that something is coming out of the snippet.

Any pointers? Any easier ways to do shader based intersections?

 

Hip file attached

Cheers,

Aaron.

rayPigs.hipnc

Link to comment
Share on other sites

well this is a bit odd what you doing. not sure what the result should be. technically, you cannot evaluate an intersection with a point in space as there is no surface area to be intersected. in sops it gives you some result but I haven't found it meaningful in any way. anyways, if you want to use intersect in shader you can use the same Intersect VOP as you have in SOPs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...