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

##### Share on other sites

You need to multiply decal_val * @TimeInc to make sure that substeps are being taken into account, or else it will evaluate that every timestep and will decay much faster the more substeps you add.

##### Share on other sites

Thank you! I think I did something wrong because I tried that but I couldn't see the effect.
I'll have a go again!

Cheers!
Andrea

##### Share on other sites

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

##### 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
• 1

##### Share on other sites

Yes, that is what I experienced.

I will try now to find the complement of the decay (1-0.85 = 0.15) and multiply that for the @TimeInc.

But I am not sure this will work...

## Create an account

Register a new account