Are you using instanced cube geometries as blocks? Minecraft actually uses a non-interpolated marching cubes, only the surface of volumes are polygonized, the actual blocks are voxels of a 3D texture (the chunk). If you would fill the volume with cubes you will end up with millions of polygons and overdraw too.
Also it would be easier if you explain in short how you approach things rather than expect to fully read into the code understanding your terminology. (additionally, providing full code or better a live example of course is commendable)
With every chunk, I sort the blocks and their positions into individual arrays corresponding to each block. I then create a instanced mesh for every different type of block in the chunk. The blocks that are fully covered are not shown, yet I still receive performance issues.
In that live example they are shown? Anyway there is a massive amount of drawcalls, you also don’t need to issue different drawcalls on different block types, for this an atlas (WebGL1) or array texture (WebGL2 only) is used, which Minecraft does as well.
You should use the devtools and make a short performance recording to spot bottlenecks.
Hello, I was looking at this part of the code, and I was wondering how the uv corresponds to the atlas, thank you.
edit: moreso explain to me how the uv mapping works with the texture atlas and the blocks. the keys given in the uv array just seem so random, and the 0.5 confuses me too. What do the keys correspond to, and what does the 0.5 mean when it comes to mapping the textures to the geometry