Jump to content

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.



Edited by Wenye
Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...