Definitely not worth it. Either cull entire chunks that are completely outside the frustum, or sort your geometry using octrees and maybe cull individual blocks like that. I personally just use display lists for my cubes, and I want to convert it over to VBOs someday, maybe. I haven’t seen a huge performance increase when I switch to VBOs, so maybe I wont. Probably the biggest optimizations I have that really truly increased my frame rate were only rendering visible faces, making all my geometry static so I only ever create one instance of each tile type, and using a spritesheet. Those three things alone probably tripled my frame rate. I’ve heard frustum culling in a voxel game isn’t entirely useful, because there really just aren’t as many vertices to be rendered as in a non-voxel game, but it still can raise the FPS by a little. Quite honestly, besides occlusion culling (which I have no idea how to do) and frustum culling, those three optimizations are all I currently need to get the game running fast.
The reason you should use VBOs is because they’re faster to update than immediate mode + display lists. Plus, they’re not deprecated. >_>
What really helped was pre-computing the faces. When a block is created or removed, check to see if it shares that face with another block, if so, check a Boolean to not render that face. That way it is a single Boolean if check and not a hash look up check to see if a face is rendered. If a block has adjacent blocks on all sides, nothing is rendered. This doubled to tripled fps at 100k+ cubes. Also, going from batching via fixed function vertex arrays instead of display list gave a huge performance boost. I think it is because I did not have a chunking system.
I here people talking of rendering 1k 16x16x16 chunks. That is like 4 million cubes. I can only think that Frustum culling chunks is a huge performance boost. And it is if you tink about it. Completely throwing out chunks of 4k + cubes if they are not in the view is worth the computation. You could drop the 4 million down to 1 million or less. I am not a cube world guy because for some reason I absolutely HATE minecraft for no reason what so ever but once I got the noise terrain generation working I was like “That looks cool”.
@theagnetd only reason why I am not doing static VBOs is that the dude teaching the class made a HUGE point that everything MUST BE GL11 because he is convinced that windows only supports GL11. I got him to use LWJGL instead of JOGL (nothing against Julian or w/e his name is) and made him actually tell the class that giving doubles into the GPU may slow things down. face palm Also, my laptop does not support opengl 3.0 so a bunch of modern things are thrown out.
Greedy meshing anyone?
I implemented it in my voxel engine and performance improved significantly. I managed to beat Minecraft on short render distance - with drawing enough chunks for Minecraft’s far render distance.
This is probably one of the harder optimisations to code, but it makes a lot of sense afterwards, and is definitely worth it.
Article series starts here
Actually, yeah now that I think about it, you’re right. I didn’t think about having huge worlds like that. Quite honestly, you really shouldn’t be rendering that many cubes anyway. But if you want to, then frustum culling and occlusion culling is a must. For my game, I only render chunks that are within the render distance, so frustum culling is useful, but its not a huge FPS booster.
@theagentd I should just switch to VBOs shouldn’t I? Maybe someday… display lists are so easy and its just a learning project for me. Although, VBOs really aren’t hard… its just my shear laziness that’s preventing me from using them!
Sorry, I’m on my phone right now.
You should look up thebennybox on YouTube. He creates a 3d engine from scratch using modern OpenGL techniques. In about video 12(?) he discuses and implements vbos and later he incorporates ibos.
I’ve already watched his tuts, I seriously can’t stand his voice or his coding style. He just uses terrible variable names and all that… but I did get a lot out of it!
Craftia Alpha a0.2.1:
- Added Better Frustum Culling with less view distance
- Added Stats
I took a bit of break.
Going to put up a playable jar pretty soon but can’t get it to work.