Using mask from geometry. Is this the right node?

   421   9   1
User Avatar
Member
24 posts
Joined: April 2015
Online
I have set up a simple sphere, which has been textured and displaced.

I do not want the whole sphere to be affected, so I added a maskfromgeometry node, but this does not affect the displacement. See image.

Do I have the correct node? Have I completely misunderstood how to use masking? Any help appreciated.


Attachments:
Mask.jpg (821.8 KB)

User Avatar
Member
5116 posts
Joined: Feb. 2012
Offline
Hi,

You need to normalize the dist attribute and multiply that with the displacement amount inside the shader for it to take affect. The shader won't automatically pick that up.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
24 posts
Joined: April 2015
Online
animatrix_
Hi,

You need to normalize the dist attribute and multiply that with the displacement amount inside the shader for it to take effect. The shader won't automatically pick that up.

Thanks so much for the advice.
You will see from the attached image that I still have a long way to go to know a 10th about Houdini. I have attempted to follow what I think you mean, but as you can see, A, it has not worked, and b, clearly I have not understood fully how to do what you suggested.

I used an Attribute Promote for l min and max of @dist.
Then used an Attribute Wrangle to remap @dist to 0–1:
In the RS Material Builder, I used an RS Point Attribute node connected to an RS Math(multiply) to scale displacement.

Happy to upload the file if it helps. Thanks for your patience!!

Attachments:
Mask3.jpg (945.0 KB)

User Avatar
Member
5116 posts
Joined: Feb. 2012
Offline
RS Point Attribute should use the attribute name dist, not float.

Also promotion and the fit VEX code needs to come after the Distance from Geometry node because the attribute is created there. You can't modify the distance values before they are created.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
9406 posts
Joined: July 2007
Online
Based on your first screenshot you already have remapped f@mask attribute, no need to deal with dist

So you can directly bind "mask" attribute in the shader
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
24 posts
Joined: April 2015
Online
animatrix_
RS Point Attribute should use the attribute name dist, not float.

Also promotion and the fit VEX code needs to come after the Distance from Geometry node because the attribute is created there. You can't modify the distance values before they are created.

Ok. Updated as you suggested but still getting an error on the maximum promotion, which I guess is why it still does not render correctly.




tamte
Based on your first screenshot you already have remapped f@mask attribute, no need to deal with dist

So you can directly bind "mask" attribute in the shader

Hey Thanks. I could not use a bind node inside the RS Material Builder so I used a RS Attribute which seems to work correctly.

Attachments:
Mask_Prom.png (1.3 MB)
Mask_Attribute.jpg (766.8 KB)

User Avatar
Member
5116 posts
Joined: Feb. 2012
Offline
You get that warning because you need to turn off Delete Original in the first Attribute Promote:

Attachments:
promote.png (626.7 KB)

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
24 posts
Joined: April 2015
Online
animatrix_
You get that warning because you need to turn off Delete Original in the first Attribute Promote:

Thanks, that removes the promote error.

tamte
tamte's method works and is simple, but I would still like to understand and resolve your method.

From the image, you can see it is still not displacing correctly. In fact, if I remove the Attribwrangle, it makes no difference to the render. Could my VExpression not be valid?

Edited by iso - yesterday 15:02:10

Attachments:
Mask_Prom2.jpg (866.9 KB)

User Avatar
Member
5116 posts
Joined: Feb. 2012
Offline
Yes you can't access detail attributes like that in a Point Wrangle. You need to use the detail function:

detail ( 0, "dist" );

It's also a good practice to rename these so you don't have 3 attributes with the same name, where the second detail attribute will overwrite the first one.

Or you can branch them out and connect to different inputs of the Wrangle SOP and access them using the second and third input:



But for your displacement, mask is the attribute you need like tamte said.

Attachments:
dist.png (592.3 KB)

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
24 posts
Joined: April 2015
Online
animatrix_
Yes you can't access detail attributes like that in a Point Wrangle. You need to use the detail function:

detail ( 0, "dist" );



Many thanks. Works perfectly.
  • Quick Links