Jump to content
Wenye

Natural Randomness Ratio and Scale Ramp

Recommended Posts

For example, if I was creating debris emission for a destruction scene and I wanted the debris to vary in size, how would I go about creating a ramp that would affect my original points and allow control over the scale of my debris geometry and the ratio of larger vs smaller geometry to be used? Any suggestions would be much appreciated. Thank.

 

piles7.jpg

Edited by Wenye

Share this post


Link to post
Share on other sites

FIrst of create a random number between 0-1, you can use the @ptnum or @id (if you have one) attribute, you can then reference this random number in a ramp expression. The code would look like this:

float rand = rand(@ptnum);
v@scale = chramp("Scale", rand); 

You can then hit the spare parameter toggle next to the vex expression and adjust the ramp curve to how you want it.

Bear in mind this will distribute the scale of the debris to between 0-1 so if you want them to be a different scale to this you would need to fit the scale value after the ramp expression.

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

×