Original Post
Hi! I want to start to code a tile engine, but i need some suggestions how to render the tiles.
I thought of 2 methods
First:
I have one VertexBuffer with just one Quad. Then changing
the WorldPosition and Texture Position for every Tile (with Matrices) and draw it. I do it for all Layers in my map.
2. I have a big VertexBuffer for the whole screen. Lock it
once per frame and write the new tile data in it. i will
arrange the vertex data in the buffer in a way, that first the
tiles will be rendered wich are on the first texture then
tiles of the secon texture and so on to prevent setting for
every tile a new Texture. Next thing are the layers of the
map. At the moment i don''t how to do this. One VertexBuffer
for every layer? or big big Vertexbuffer arranged that
renders first, second,...xxxLayer. When i''m using the big big
vertexbuffer method i need to have a list of texture used
in each layer and arrange the buffer in a way that every
texture is only set once per layer(so that the z order of
the layers will be correct)
The second method is much more complicated than the first but
i can imagine its faster although i lock a vertex buffer but i minimize the other operations like calculating the position
in World and in Texture
What do you use for rendering maps? Do you think my methods
are usable? Please give me your opininons or make suggestions
to make it better