Creating a soft gradient 'attribute randomize' pscale?

   2957   2   2
User Avatar
Member
1 posts
Joined: Jan. 2022
Offline
I'm trying to create a gradient look where I have a box scattering along my geometry via 'copy to points' and want to have the bottom part rescale to something small, and the top rescale to a larger size. So the box scatter would shrink as it gets lower on my geometry.

But I can't figure out a way to do that with a 'soft' transition. I'm new to Houdini still, but the closest I got was to use a group - bouding box - plugged into an attribute random. But its a very harsh line. What do I do to soften this?

Attachments:
Screenshot 2022-01-29 223353.png (1.8 MB)

User Avatar
Member
538 posts
Joined: Nov. 2016
Offline
I'd use a point wrangle node to establish a base pscale on your emitting geometry.

Something like:

float minsize = ch('min_size');
float maxsize = ch('max_size');

f@pscale = fit01(chramp('pscale_over_y', relbbox(0, v@P).y), minsize, maxsize);

Then click on the small slider icon at the right of your code to get sliders for your minimum and maximum size, and a ramp for the falloff.

Then if you want to add randomness, you can use an attribute noise down the graph with operation set to multiply.

Hope that helps.
Edited by Tanto - Jan. 31, 2022 12:57:14
User Avatar
Member
447 posts
Joined: April 2018
Offline
A non-VEX approach:

Attachments:
pscale fade.png (522.4 KB)

  • Quick Links