Skip to content

Hybrid Tiled Renderer #398

@obiot

Description

@obiot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions