Jump to content
Sign in to follow this  
Solarize

Mesh Border Mask

Recommended Posts

Hello, 

I'm quite new to Houdini and I have a pretty simple question which I haven't been able to figure out. Suppose an open convex plane, how can I make a mask from border to center going from black to white? Attached example images. 

In my case, a height mask could do the trick too due to its convex shape, but ideally I prefer the border. 

Thank you

 

border_mask.jpg

Share this post


Link to post
Share on other sites

you can use group SOP to find the border points

then Falloff SOP to get the distance

and then remap as you need

 

ts_dist_from_border.hip

Share this post


Link to post
Share on other sites

Awesome! Seems to be exactly what I'm looking for. Thank you. Another newbie question. How can I access that inside a pointvop VEX for example? 

Share this post


Link to post
Share on other sites

like any other attribute, use Bind VOP, specify name, in this case falloff, and keep type as float, then connect to whatever you want to drive with it

Share this post


Link to post
Share on other sites

Perfect! That helped a lot. As I had it connected to the second input I had to use importpoint instead of bind. Initially I thought I had to access it through a code. 

Share this post


Link to post
Share on other sites

assuming the shape is flat (it has to have boundaries) you can also do the following:

Use a divide sop to remove shared edges (toggle at the bottom), though it looks like on the left image this may already be the case.
Put an "primitive" or "ends" SOP and set the mode to "unroll" (easier to find in the ends sop), you should now have the boundary line.

then you can do the rest in an attribute VOP or wrangle, for example: (input the main geo in the first input, and the boundary in the second)

f@falloff = xyzdist(1, v@P);
v@Cd = f@falloff;
 

 

Edited by acey195

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
Sign in to follow this  

×