Slow down rendering of one frame

I am trying to push a lot of parameters inside BabylonJS in order to have the best rendering possible of one image. The problem is that doing that, I obviously make my browser and computer freeze for several seconds (sometimes 20) when the rendering of this frame happens.

I was wondering if there was a way to limit the rendering process in order to avoid that? Maybe some option in the Engine or Scene, but didn’t find any?
Otherwise, we could imagine splitting the image in several pieces and render each one after the other. But not sure what would be the best way to do that in BabylonJS.

Thanks, Pichou

@PichouPichou, maybe using SceneOptimizer could help here?

1 Like

Thanks for the idea @gbz. Unfortunately, I don’t think it will help :hugs:

As you can see one of the main SceneOptimizer parameters is targetFrameRate which means that it will optimize your scene in order to keep a good frame rate.

But in my case, I am rendering only one frame! :wink:

There is no built in option as it sound like a really edge case scenario that would not scale accross devices.

The only way you could nevertheless make it work will be to add your own kind of tiling process probably playing with scissor rect info or with render target textures ?


Cool I didn’t know about this enableScissor feature!

Indeed it seems to be the right candidate to answer this issue:

Plus as tested in this playground, it seems like we can keep tile already rendered on the canvas while drawing the new one. :hugs:

1 Like