Jump to content
Aaron Auty

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×