effekseer / EffekseerForGodot3

MIT License
133 stars 9 forks source link

Manager update can be handled better to remove stuttering in very high FPS scenes (needs testing) #1

Closed twaritwaikar closed 1 year ago

twaritwaikar commented 3 years ago

https://github.com/effekseer/EffekseerForGodot3/blob/e54e76533b29202fbffd263f7e9ab02bcc8396f1/Dev/Cpp/src/EffekseerSystem.cpp#L104

The way this function is handling the deltaFrame which is passed into manager->Update() (line 107 to 112) does not work well in very high FPS scenarios (E.g. 100+ FPS).

I have NOT YET had the chance yet to test this in Godot but I have integrated Effekseer in our separate engine, where I tried the logic in this repo (as linked above) and I found that the particle animation was stuttering (moving by small amounts suddenly after large delta times).

I fixed this by switching to the logic given below:

// Member variable defined in my renderer .h file
float m_FrameProgression = 0.0f;

// ------------------

// In the middle of the rendering function
m_FrameProgression += 60.0f * deltaSeconds;
m_Manager->Update(m_FrameProgression);
m_FrameProgression = 0.0f;
ueshita commented 3 years ago

I didn't take into consideration the high FPS. That bug will be fixed in Beta2. Thank you for your contribution.