Textures are taken from an array texture. Every segment knows where it starts within that vertex array and how many vertices it has, both for opaque faces and transparent faces. When tesselating first the opaque faces are tesselated for every segment and then the transparent ones. When a chunk needs to be rendered for the first time a VBO ( glGenBuffer, GL_STREAM_DRAW, etc.) for that chunk is generated containing the possibly visible/outside faces (neighboring chunks are checked as well). NOTE: I am not waiting for them to be generated, they will just not be visible immediately. This means that chunks might not show right away. ![]() Starting from level 0, bedrock, it can go as high as you want (unlike minecraft where the limit is 256, I think).Ĭhunks are queued for generation on a separate thread when they come in view and need to be rendered. This allows to create an 'infinite' world that can cache-in and cache-out chunks.Įvery chunk consists of an array of 16x16x16 block segments. Chunks are stored in a dictionary, where I can select them based on a 64bit X | Z<<32 key. Right now my world is built using chunks. ![]() Voxel engine (like Minecraft) optimization suggestions?Īs a fun project (and to get my Minecraft-adict son excited for programming) I am building a 3D Minecraft-like voxel engine using C#.
0 Comments
Leave a Reply. |