Jump to content

Rays from camera to geometry intersections


Recommended Posts

Thanks fencer, but your example detect if poligon look to camera or not. But I need to detect first intersection and change the color for it. Im stuck with rayhittest function not working for me.

Edited by tamagochy
Link to comment
Share on other sites

1 hour ago, tamagochy said:

Thanks fencer, but your example detect if poligon look to camera or not. But I need to detect first intersection and change the color for it. Im stuck with rayhittest function not working for me.

can you describe a bit more, I'm losing idea)

Link to comment
Share on other sites

I need get result like wirframe mod for viewport but for render. All edges in front of camera is brighter than covered one. I need the same but for polygons. I will use semitransparent material and whant to change colors of the covered polygons.

Link to comment
Share on other sites

I thought you needed this in shader context, which is why I suggested rayhittest. In sops, theoretically, you should be able to use the intersect vop to send a ray from the camera to the primitive. It returns the first primitive number hit by the ray. Compare that to the current primitive number you are interested in, and if they are not the same prim, then it is an occluded primitive and should be colored differently.

Link to comment
Share on other sites

Done in SOPS. You can figure out how to convert this to shops, or else just use in sops, create an attribute and bring that into a shader for color effects. Note, I did not account for space transformations in the VOP network. You'll want to make sure everything is in the same coordinate space to do the ray intersection correctly.

camera_rayhit.hiplc

  • Like 1
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...