ultraq / redhorizon

Recreating the original 2D Command & Conquer games
Apache License 2.0
6 stars 4 forks source link

Implement instancing / batch rendering techniques to speed up map rendering #44

Closed ultraq closed 3 years ago

ultraq commented 3 years ago

As expected, drawing each map tile and element with its own draw call is very slow 😅 Luckily, a few ideas for how to go about solving this exist, and the ones I'll need to look into include:

Resources:

ultraq commented 3 years ago

Got a batch renderer working without too many restrictions on it now, so pretty happy with that. I don't know how to fit in instancing just yet as I don't really have many instances of the same thing (though every map tile could be an instance of the same 24x24 mesh with different texture coordinates and transforms for positions 🤔). I think the batch renderer will do for now - when I start having to create many of the same units/structures, particularly with different palette shifts, I might look into instancing again.