Original Post
Hello guys,
I'm sure that its been solved here many times, but I checked about 40 topics in this subforum and I did not found a solution to my problem. All I found was rendering routines for staggered map.
I have a large isometric map, which is chunked into blocks that are also diamond-like (its just like a small diamond map). I load 3x3 chunks of that map, to be sure that I can render also corners where chunks concatenate on screen.
I've managed to write loading/rendering algorithm for that map, but problem is that its very slow, about 20 FPS, even when I'm not rendering offscreen. When I disable all OpenGL rendering calls, I still get 20 FPS, so its definitely caused by rendering algorithm and not by rendering itself.
I render like this (pseudo code):
As I said, the problem is that this algo is very slow (and stupid), even when I remove renderTile() line.
I guess that I need to find correct yMin/yMax and xMin/xMax to speedup rendering. But I'm not sure if its enough, maybe there is better algorithm to render it without rendering 3x3 block matrix.
If you have some working snippet, I'll be very grateful if you share it with me. Or link to some topic where it was solved already is enough.
Thank you very much for any input...
(Ah, and sorry for bad English :)
PS: My tile sprite resolution is 80x40 pixels, and it looks like this one:

Here is image how that diamond map looks like:
I'm sure that its been solved here many times, but I checked about 40 topics in this subforum and I did not found a solution to my problem. All I found was rendering routines for staggered map.
I have a large isometric map, which is chunked into blocks that are also diamond-like (its just like a small diamond map). I load 3x3 chunks of that map, to be sure that I can render also corners where chunks concatenate on screen.
I've managed to write loading/rendering algorithm for that map, but problem is that its very slow, about 20 FPS, even when I'm not rendering offscreen. When I disable all OpenGL rendering calls, I still get 20 FPS, so its definitely caused by rendering algorithm and not by rendering itself.
I render like this (pseudo code):
int BLOCK_WIDTH = 32; // number of tilesint BLOCK_HEIGHT = 32; // number of tiles POINT cameraPos = getCameraPos();for (int i = 0; i < 3; i++){ for (int j = 0; j < 3; j++) { BLOCK block = blockMatrix[j]; POINT blockPos = getBlockDrawPos(cameraPos, block); int xMin = 0; int xMax = BLOCK_WIDTH; int yMin = 0; int yMax = BLOCK_HEIGHT; for (int y = yMin; y < yMax; y++) { for (int x = xMin; x < xMax; x++) { POINT tilePos = getTileDrawPos(blockPos); if (isTileOffscreen(tilePos)) continue; else renderTile(block.tileMap[y][x], tilePos); } } }}As I said, the problem is that this algo is very slow (and stupid), even when I remove renderTile() line.
I guess that I need to find correct yMin/yMax and xMin/xMax to speedup rendering. But I'm not sure if its enough, maybe there is better algorithm to render it without rendering 3x3 block matrix.
If you have some working snippet, I'll be very grateful if you share it with me. Or link to some topic where it was solved already is enough.
Thank you very much for any input...
(Ah, and sorry for bad English :)
PS: My tile sprite resolution is 80x40 pixels, and it looks like this one:

Here is image how that diamond map looks like: