wMarciano_Art Posted July 23, 2023 Share Posted July 23, 2023 Hello all, I've been working on this setup for camera-space object silhouettes that will be used to conform/cull objects outside of them. While my setup is functional, it is sluggish...despite me trying to be quite performance conscious. I've prepared a simple example scene for you all to show where I'm at. The main sticking points here are Triangulate2D (slow, but faster than any alternative I've tried), and the group from bounding object (not too bad in the example file, but terrible with more complex silhouettes). I'd also love some help with conforming the points outside the silhouette back into it– the file I attached just does a simple minpos() to the silhouette because it's hard to do better without sacrificing performance. As a result, it fails when limbs get close together or if the geo to be conformed is too low-res. Hopefully that all makes sense! silhouette_setup.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted July 24, 2023 Share Posted July 24, 2023 Have you taken a look at the Labs Extract Silhouette node? Quote Link to comment Share on other sites More sharing options...
wMarciano_Art Posted July 24, 2023 Author Share Posted July 24, 2023 2 minutes ago, Atom said: Have you taken a look at the Labs Extract Silhouette node? Yeah, but it is both less performant + doesn't support perspective cameras Quote Link to comment Share on other sites More sharing options...
animatrix Posted July 24, 2023 Share Posted July 24, 2023 Hi, You can check for inside by raytracing your copied spheres against the 2d silhouette geometry from the camera direction with something like this: string cam = chs("cam"); vector pnear = fromNDC ( cam, set ( 0.5, 0.5, 0 ) ); vector pfar = fromNDC ( cam, set ( 0.5, 0.5, -0.001 ) ); vector dir = normalize ( @P - pnear ); @N = dir; After this you can either use a Ray SOP or call the intersect VEX function. In my test, I get about 5-6x speed up on that part. There are probably other optimizations that can be made. 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.