Closed GlebVST closed 2 years ago
TIL that there can be multiple render loop functions. Thanks for bringing this up. I updated ironically yesterday on master a new Engine
component. It's not on NPM yet, but it allows much finer control. Additionally, since the original version you reference there are hooks for onBeforeRender and onAfterRender that run in the existing render loop. Here is the babylon code that schooled me as well - I had mistakenly thought there was a single runRenderLoop, but it's a list:
https://github.com/BabylonJS/Babylon.js/blob/ac1eb10bf5198373a33c1a0015581037c313e95a/src/Engines/thinEngine.ts#L1564
@GlebVST - Looks like when adding your own render loop that it should be preceded by
// calling this with no parameter will clear the active render loops
engine.stopRenderLoop();
I will update the examples - please re-open if you have additional questions or comments. (closing for inactivity)
Hi,
While profiling an app that's using this lib (pretty dated on version though) with non-declarative approach described here in the docs have figured out there is double rendering going on due to a call to
scene.render()
inside the loop onSceneMount!Was scratching my head why the FPS doesn't go higher than 33%!
I though maybe newer versions has this fixed but looking at corresponding example shows the same double rendering:
Maybe fix the example and put some alert in the docs?
Best regards, Gleb