Jump to content

Solver SOP and substeps


Recommended Posts

Hi Guys,

I am trying to solve a small problem but I can't figure it out precisely.
I want to use a Solver SOP in order to have a color decay effect.
Let's say I decide that the color decays 15% each frame, so I put @Cd.x *= 0.85: in my wrangle

The problem happens if I increase the number of substeps to 2 or 4, in that case, obviously, the decay rate of 15% will be each interaction and not each frame.
Could you please help me with this?
In the attached image, I use a random to decide how much to decrease the color of the point, based on @dist attribute...

 

Cheers!
Andrea

decay.PNG

Link to comment
Share on other sites

should be on that last line @Cd.x *= decay_val * @TimeInc;

 

EDIT:

seems like I wasn't paying attention 4 years ago. That's definitely wrong if you're trying to decay something by multiplying (it'd be okay if you were subtracting & clamping). Instead try something like

v@Cd.x = max(0, v@Cd.x - (chf("decay")* f@Timeinc));


or maybe

float decay_rate = 0.2;

v@Cd.x *= pow(decay_rate, f@Timeinc);

 

decay.hiplc

Edited by jamesr
incorrect reply. add hip file
Link to comment
Share on other sites

I think doing this is not correct  @Cd.x *= decay_val * @TimeInc; Do the math and you will have almost no value to work with; Its better that you subtract and apply a maximum or a clamp after the decay.

Edited by Pazuzu
  • Like 1
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.

Guest
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...