Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Generic Tileset Batching Using Vertex Buffer Abstraction #1238
Alright, this pull request is following #1283 to implement the tileset drawing as an indexed triangle list using the previous vertex and index buffer abstractions I added for users. This significantly reduces redundant code as well as brings the tileset functionality to systems where it did not previously exist, so long as those systems implement vertex and index buffers (such as Direct3D9). This partly addresses issues like #1056 and will make systems like OpenGLES and Direct3D11 easier to provide.
This redesign also makes several changes about the way the tile batching is approached. We no longer rebuild the tile model every time a tile is added or deleted, but simply set a dirty flag to update the model on the next frame. This essentially batches together several adjacent
I prepared a benchmark that adds 1,000 tiles to a room and then draws the fps to compare the changes. Because GM8 has no facility to benchmark code, I simply ran the test before adding any calls to
This pull request Ding Two (With a Texture)
Now, when I did the benchmark again, for the third time in total, I used an actual texture and had added caching of the vertex format.
This pull request Ding One
The first benchmark was the first actual benchmark on the new vertex functions too, so no system actually saw a significant improvement on fps yet. What was noticeable is that the add times then became pretty constant between the different systems.
To ensure that my fixes for #1199 remain intact, I ran the Tile Collision Demo from that PR on all 3 graphics systems, showing that Direct3D9 also supports it now.
The duplication of
screen_redraw is the only thing that's bothering me. I thought fundies fixed that. Was that rolled back when I rolled back his YAML changes? Or am I mistaken? This will conflict with that refactor, if it exists somewhere.