3 ms·
And for that, you could again look at what Minecraft-like games have come up with. Minetest, for example, groups its "voxels" into cubic chunks, which are then
by Sylos 8y ago
And for that, you could again look at what Minecraft-like games have come up with.
Minetest, for example, groups its "voxels" into cubic chunks, which are then loaded depending on a max distance and presumably some sort of a ray tracing approach to figure out, if the "voxels" in such a chunk are visible.
- namibj 8y agoMinecraft itself throws a chunk at a time (a horizontal 16x16 section of the world) at it's rendered, which then spits out an OpenGL model for the rendering. (iirc). This is the, or one of the, reason(s) why clipping through one block gives the ability to see through all those in the middle, instead of 'just' seeing the next block adjacent to the one you are clipping into. The ray tracing is just that only faces of voxels that touch air or another non-solid block (fencepost,liquid,torch,etc) are included into the OpenGL model, along with their texture. The raytracing is done by the GPU, and handled via the depth buffer.
- meheleventyone 8y agoFor something like Minecraft where the voxels are comparatively huge they’re probably using something like Marching Cubes to extract a poly mesh from the voxel chunks rather than ray tracing. You can actually get pretty far with surface extraction techniques see for example the VoxelFarm engine.
- Sylos 8y agoI probably should have highlighted this better, but I was not talking about Minecraft in the second part of my comment. I was talking about Minetest: https://www.minetest.net/ https://www.minetest.net/ Which is essentially a game engine for creating Minecraft-like games. Minecraft itself grew historically and is not state of the art anymore. Which especially shows in the pillar chunks that you mention. Their size is 16 x 16 x world-height, meaning that the world height can only be so big (256 blocks in the case of Minecraft). Minetest has cubic chunks, 16x16x16, which allows for virtually infinite world height, but also for loading those chunks in a much smarter way than Minecraft has it (which basically just loads chunks in a circle around the player). When you're in a cave, for example, you don't need 400 blocks in all directions to be loaded, you just need to see the next wall. Whereas when you're standing on a mountain, you do need to be able to see all of the chunks that make up the surface of the surrounding terrain, but you again don't need any blocks to be loaded below the surface. And for that, I assume they use a raytracing approach. Periodically check what chunks are in line of sight for the player and make sure those are loaded. When on a mountain, that's a lot of chunks, when in a cave, it'll only be a few. So, I'm not talking about whether they are rendered or not, I'm talking about them being loaded into RAM or not (which obviously does also result in them not being rendered when they're not loaded).