RobustToolbox icon indicating copy to clipboard operation
RobustToolbox copied to clipboard

Refactor TileEdgeOverlay

Open metalgearsloth opened this issue 1 year ago • 2 comments

When trying to screenshot vgroid I noticed a not-insignificant amount of CPU time was spent on TileEdgeOverlay iterating thousands of tiles.

Not entirely sure if this is the best way to slot it into the existing tile rendering as I'm not sure how expensive stuff like GLBuffer ctors are (otherwise I'd just allocate a new one whenever it changed size and slap the edge quads into the same buffer). Alternatively I could make the one buffer and slap edge sprites onto the end which might also be better? PJB would know more.

image

metalgearsloth avatar Jul 10 '24 04:07 metalgearsloth

It looks like all edges should be added to the texture atlas, and then be used in RenderCommandDrawBatch, which would not just save the rendered texture, but also draw all sprites with one call to RenderCommand, it would greatly increase productivity, even during generation, which constantly creates new tiles

TornadoTechnology avatar Aug 18 '24 18:08 TornadoTechnology

Can it fix https://github.com/space-wizards/RobustToolbox/issues/5259

?

TheShuEd avatar Oct 07 '24 17:10 TheShuEd

after this PR, tiles with same edge priority looks like this

image

TheShuEd avatar Apr 17 '25 15:04 TheShuEd