How to delete outward facing polygons, eg of a building

   1165   2   1
User Avatar
Member
7 posts
Joined: 10月 2021
Offline
I'm trying to separate exterior and interior poly groups for some Kitbash buildings. Is there a way I can create a hull around a building, then use rays from that to blast away the outermost polygons?

The thing I can't wrap my head around with VEX and the 'intersect' function is: I want to run it over the points of the hull (1st input) since those would be the ray origins, but then I need to delete primitives from the building (2nd input), and as far as I know there's no way to do that. Similar situation with the Ray SOP.

I tried shooting rays from the building to the hull and deleting points based on a threshold dist value, but since in that scenario rays are also originating from points INSIDE the building that I want to keep, and since a building has so many little nooks and crannies, I just couldn't get the desired result.

The goal ultimately is to re-bake interior textures with lighting for night scenes so they're faster to work with; so, if anyone knows an entirely different approach that'd achieve that I'm not necessarily married to this approach. But it'd be nice if there a somewhat procedural way to handle separating exterior from interior.

thanks for reading!
User Avatar
Member
4512 posts
Joined: 2月 2012
Offline
Hi,

If your model is somewhat clean, you can do something like this:

float maxdist = ch("maxdist");
vector n = normalize ( @N );
vector p = -1;
vector uvhit = 0;
int primhit = intersect ( 1, @P + n * 0.1, n * maxdist, p, uvhit );
if ( primhit != -1 )
    i@group_outside = 1;




Otherwise you have to do more elaborate checks using scattered points over the model and test for a single instance of an intersection or none, etc.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
7 posts
Joined: 10月 2021
Offline
Thank you very much! This is working quite well.

Looking closer, some of these Kitbash models have outdoor benches, patio tables, pipes, ducts, etc... that aren't conveniently grouped, and create concavities that I can't imagine any 'ray to hull' approach would be able to solve for. Could there be a 'watertightness' or volumetric approach that could deal with this? I suppose it would get pretty processor intensive.

Regardless, for my purposes right now this is fantastic, thanks!
  • Quick Links