Commit graph

5 commits

Author SHA1 Message Date
Struma
94c031b095 Revert to using GL compatibility contexts (and GLES2) 2020-11-16 21:56:19 -05:00
Aeodyn
e86548b6ba Another minor tilemap.vert fix, depending on the platform. 2020-07-30 15:40:22 -04:00
Aeodyn
050da27ca0 Brought the tilemap class mostly in line with Essential's CustomTilemap wrt animations, though at the cost of backwards compatibility.
(This could be rescued by per-tile animation lentghs in tilemap.vert, but this should suffice for now.)
2020-07-14 19:34:38 +00:00
Jonas Kulla
2f95c0613a Shaders: Prefer arithmetic conditionals to branching 2014-12-31 18:52:20 +01:00
Jonas Kulla
56226c40c6 Tilemap: Use vertex shader based autotile animation strategy
Previously, we would just stuff the entire tilemap vertex data
four times into the buffers, with only the autotile vertices
offset according to the animation frame. This meant we could
prepare the buffers once, and then just bind a different offset
for each animation frame without any shader changes, but it also
lead to a huge amount of data being duplicated (and blowing up
the buffer sizes).

The new method only requires one buffer, and instead animates by
recognizing vertices belonging to autotiles in a custom vertex
shader, which offsets them on the fly according to the animation
index.

With giant tilemaps, this method would turn out to be a little
less efficient, but considering the Tilemap is planned to be
rewritten to only hold the range of tiles visible on the screen
in its buffers, the on the fly offsetting will become neglient,
while at the same time the amount of data we have to send to the
GPU everytime the tilemap is updated is greatly reduced; so a
net win in the end.
2014-07-06 19:44:19 +02:00