Attribute transfer > opacity mask

   1334   3   3
User Avatar
Member
14 posts
Joined: Sept. 2024
Offline
Hello everyone!

I have here a basic scene where an attribute transfer is done via a sphere onto a grid. I would like the red parts to simply become invisible, meaning the alpha of the red parts should be set to 0, so that in the end, my grid gradually disappears with a gradient effect. I can't find any information on this, can anyone help me?

I'm providing the HIP file for reference.

Thanks a lot!

Edited by Anthony-Amodeo - Oct. 28, 2024 13:10:10

Attachments:
Alpha mask effect.hiplc (106.3 KB)

User Avatar
Member
405 posts
Joined: April 2017
Offline
The default point attribute that governs alpha in the viewport is @Alpha (with a capital A). Try a point wrangle like this:

@Alpha = (1-@Cd.x);

This won't necessarily affect the material in renders unless your material is set up to read point alpha.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
447 posts
Joined: April 2018
Offline
Firstly, don't use Attribute Transfer or Cd to generate a mask. It's an outdated and inefficient workflow. Use the far superior Mask from Geometry SOP to do this. You get a single float attribute, as opposed to an unnecessary 3-float attribute, and you get built-in radius and ramp control, along with a few other handy options.

Secondly, if you prefer a non-VEX route, you can use an Attribute Adjust Float SOP to drive an Alpha attribute based on this mask to control your viewport opacity.

As toadstorm pointed out above, this might not render (depending on your renderer). You usually need to import that attribute into your material and connect it to the opacity of the shader for it to render properly.

Edited by eikonoklastes - Oct. 29, 2024 02:22:23

Attachments:
mask_from_geo.png (1.6 MB)

User Avatar
Member
14 posts
Joined: Sept. 2024
Offline
Thank you so much for your answers it's very clear

I can’t seem to import this attribute into my shader's opacity. Could you tell me more about it, please? As you may have guessed, I’m very much a beginner.

Thank you!
  • Quick Links