You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this mind for a long time, and seeing again performance issue with large maps that use the pre-rendering flag, I figured it would be good to bring it back on the table.
Basically today we have two different rendering mode :
preRender true will render the whole layer on a offscreen canvas :that's fast as we only do 1 draw operation at the end, but very memory consuming on large maps (especially when using several layers)
preRender false will render the visible part of the layer at each draw : slower than the above, as it's 1 draw operation per visible tile, but very memory optimized (no off-screen buffer is used)
Both have their advantages and ultimately we should provide something in between that brings the best of both :
only render a portion of the map : ideally a "next power of 2" size compared to the viewport size (for performances reason)
at each frame update, we translate the off-screen canvas by the camera offset and just draw the missing part
we could also make the off-screen size configurable so that we could tweak it for the best performances
This discussion was converted from issue #398 on September 06, 2021 00:18.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have this mind for a long time, and seeing again performance issue with large maps that use the pre-rendering flag, I figured it would be good to bring it back on the table.
Basically today we have two different rendering mode :
true
will render the whole layer on a offscreen canvas :that's fast as we only do 1 draw operation at the end, but very memory consuming on large maps (especially when using several layers)false
will render the visible part of the layer at each draw : slower than the above, as it's 1 draw operation per visible tile, but very memory optimized (no off-screen buffer is used)Both have their advantages and ultimately we should provide something in between that brings the best of both :
we could also make the off-screen size configurable so that we could tweak it for the best performances
Beta Was this translation helpful? Give feedback.
All reactions