Jump to content

Deal with substeps and gaslinearcombination


Pancho

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

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

 

Link to comment
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?

Link to comment
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) :-)

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