NOTE: SOLVED. Sort of.
Hello everyone! First post here. I am developing in Java using LWJGL.
I’m trying to develop a first-person shooter kind of game that uses a grid-based world, such as in Minecraft. Each “block” is 1x1 wide and can vary in height freely. Each block has a top surface and four sides, so five polygons, each polygon containing a 64x64-pixel PNG texture.
My code is set up like this:
A “Tile” is class that is set of five polygons. The drawing step is done at this level.
A “TileGrid” is a 16x16 array of Tiles. (1280 polygons.)
A “TileWorld” is a 2x2 array of TileGrids. (5120 polygons.)
However, if I increase the size of TileWorld to a 4x4 grid (20,480 polygons) the frame rate drops to about 27-28 fps. It normally runs at a steady 60, and I’m hoping to keep it up in that range. I was hoping to permit the game to be able to load up and draw more than that to provide Minecraft’s open world feel.
I think using Display Lists will help, but I’m not sure how to go about using them. Every tutorial I’ve seen so far has been simple, showing off some vertex/polygon code in a list, then calling the draw on the list a bit later.
Should I call a Display list for each individual tile? Would it better to call the TileWorld.draw within a single list?
My computer can handle Minecraft with 64x64 textures easily enough with far more polygons on screen at a given moment, so I don’t think it’s a hardware matter.