tamagochy Posted June 10, 2016 Share Posted June 10, 2016 I need to find if the polygon hide another one or not to use it in shader for change colors of the hided poligons. How can i get it? Quote Link to comment Share on other sites More sharing options...
bandini Posted June 10, 2016 Share Posted June 10, 2016 http://archive.sidefx.com/docs/houdini15.5/vex/functions/rayhittest 1 Quote Link to comment Share on other sites More sharing options...
fencer Posted June 10, 2016 Share Posted June 10, 2016 (edited) ? cam_hide.hip Edited June 11, 2016 by fencer Quote Link to comment Share on other sites More sharing options...
tamagochy Posted June 12, 2016 Author Share Posted June 12, 2016 (edited) 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 June 12, 2016 by tamagochy Quote Link to comment Share on other sites More sharing options...
fencer Posted June 12, 2016 Share Posted June 12, 2016 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) Quote Link to comment Share on other sites More sharing options...
tamagochy Posted June 12, 2016 Author Share Posted June 12, 2016 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. Quote Link to comment Share on other sites More sharing options...
bandini Posted June 12, 2016 Share Posted June 12, 2016 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. Quote Link to comment Share on other sites More sharing options...
bandini Posted June 12, 2016 Share Posted June 12, 2016 http://archive.sidefx.com/docs/houdini15.5/vex/functions/intersect Quote Link to comment Share on other sites More sharing options...
tamagochy Posted June 12, 2016 Author Share Posted June 12, 2016 If you can make simple scene to explain me how to use it in shader context it would be grate, because I have no luck with it. I made scene with attributeVop and intersect node inside. It work not I expect. Thanks! rayIntersec.hip Quote Link to comment Share on other sites More sharing options...
bandini Posted June 12, 2016 Share Posted June 12, 2016 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 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.