Skip to content

Multi-pass rendering optimization in renderer level 1 & level 2 #1779

@TheJJ

Description

@TheJJ

In #1645 we implemented rendering layers, but there's some optimization still possible.
my idea there was (and we should discuss/continue from there):

The renderer has two "levels", the high level variant is level 2, the lower level (closer to opengl instructions) is level 1.

We should have something layer-like (ordered multi-pass rendering) in both renderer levels.

There's basically two things to do multiple passes in renderer "level 1" to draw their layers:

  • objects (town center e.g.) -> draw shadows, their building parts
  • terrain -> overlay and blending

Layer 2 render passes could use layer/pass features in layer1 then, if it makes sense.

To prevent binding the framebuffer when drawing in layer 1 too often, the resulting layer1 instructions somehow have to be batched (so the buffer can remain to be bound in the correct order) - this was our long-term idea for the multiple layers anyway.

Concrete idea to implement this:

  • renderer users submit all render instructions to the renderer as they need them
    • and have it all in memory, yes
    • but later we could optimize maybe by processing one map area after the other? especially when zoomed out)
  • re-order and optimize (minimize binding switches of textures, shaders, ...) the draw instructions
  • from this optimized list, perform the draw calls (to the correct framebuffer) with minimal binding switches (we ordered for that just before)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: rendererConcerns our graphics rendererimprovementEnhancement of an existing component

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions