Jump to content
Sign in to follow this  
Pancho

Deal with substeps and gaslinearcombination

Recommended Posts

I use a gaslinearcombination to multiply the viscosity over time with something like 1.02. Works fine.

Problem: it isn't independent from the amount of substeps I use.

If I use 1 substep, it will evaluate once per frame. If I use 8 substeps the value increases so much faster since it evaluates 8 times per frame. Since substeps may vary often depending on the resolution and precision, I wolud like to keep the increase of viscosity constant per time, not per evaluation. So, how do I deal with this kind of stuff? I guess changing values in a popvop will suffer from the same problem. Anybody an idea?

Cheers

Tom

Share this post


Link to post
Share on other sites

Not sure how to use @TimeInc.

Only solution which comes to my mind is to use FIT with the value of viscosity on the beginning of the frame and the end of the frame and use the relative time within the frame to interpolate between those values, but I guess this would require 2 additional attributes on each particle and with 18mil this will be an issue. And the gaslinearcombination wouldn't allow for this kind of coding.

I thought there would be something like a global checkboxx which will increment all these values either per each substep or per substep in a fashion that it will be consistent per frame.

 

Share this post


Link to post
Share on other sites

Hi Tom,

From my understanding I think @TimeInc is the length of time for one substep, however rethinking this problem, since it is a multiplier, and you want say 1.02 per second, so probably something like pow(1.02, 1.0/substep)? so that they match 1.02 per second upon multiplication?

Share this post


Link to post
Share on other sites
3 minutes ago, violalyu said:

Hi Tom,

From my understanding I think @TimeInc is the length of time for one substep, however rethinking this problem, since it is a multiplier, and you want say 1.02 per second, so probably something like pow(1.02, 1.0/substep)? so that they match 1.02 per second upon multiplication?

Sorry my bad, if it's 1.02 per second you could probably do pow(1.02, @TimeInc), if it's 1.02 per frame then probably pow(1.02, 1.0/substep) :-)

Share this post


Link to post
Share on other sites

e^Timestep seems to work for me. But you need to specify the multiplicator differently. Instead of using a factor of 1.02, I need to use one of about 1.8, since this will happen 30x within one second (30fps). Need to check what happens if I use 24fps and whether I need to change the multplicator again.

Timestep on its own didn't work instantly. Though I used 1.02 as the factor, my values became smaller. 1/Timestep and the results went through the roof, at least with 1.02.

Edited by Pancho

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
Sign in to follow this  

×