As some of you know, we are programming an MineCraft-like game. This works very well.
We are allowed to flyring around, selecting blocks, etc....
Now we have a real problem. We want to add a block if somebody clicks the left mousebutton. But if we add a block we have a graphic problem.
The world is divided in chunks (16*16*16 blocks). If we add a block or sometimes if we are flying around some chunks are going to dissapear. We don't know why and so we want to ask you if you can help us.
I've added the complete sourcecode.
Feel free to use it for your own projects if you want.
I'm new in this forum. At our university we have to program a game with DirectX9.
Me and some other students wanted to program a Minecraft-like game, but without unlimited terrain (don't worry ) Now we have a problem with our performance.
Our strategy is, that we have a chunk with 16^3 blocks. We are going through all blocks and look if there is a neighbour above, in front, ..... If there is one we dont put the vertices and indices of this side of the cube into the buffer. This works really quick.
Now we made a class for a chunk. In this class we create the buffers and put in the vertices and indices and save them in a std::vector.
On rendering we fill the buffers with memcpy and draw the primitives.
If i try to draw 4 chunks, everything works fine with 60 fps. But if I try to draw more chunks (e.g. 64) the performance goes down to 8 fps.
I've added my source-code and wanted to ask for a strategy to improve the performance.