Closed Alchemist0823 closed 3 years ago
Hi, thanks for the suggestions!
I'm not quite sure what you meant by making transparent blocks in a single mesh with an atlas. So far, each chunk is separated into 4 sub-chunks, and each sub-chunk has two meshes, one transparent and one opaque. They're both using the same atlas generated from the backend at textures/atlas.png
. What do you mean by making transparent blocks in a single mesh? Do you mean to group all transparent blocks into one mesh in chunks instead of separating them into subchunks along with opaque meshes?
In terms of frustum culling, I'll definitely put some work on it. I disabled the default frustum culling because chunk's mesh bounds were erroneous and would often disappear from the scene. A 60% reduction in rendering cost definitely sounds fantastic!
I'm not quite sure what you meant by making transparent blocks in a single mesh with an atlas. So far, each chunk is separated into 4 sub-chunks, and each sub-chunk has two meshes, one transparent and one opaque. They're both using the same atlas generated from the backend at
textures/atlas.png
. What do you mean by making transparent blocks in a single mesh? Do you mean to group all transparent blocks into one mesh in chunks instead of separating them into subchunks along with opaque meshes?
If that's the case, I was wrong. I will look more into the performance optimization.
That would be great! Thank you~
I briefly went through your code. and did a profiling on the webpage. Your work is amazing. Just some suggestions here.
Rendering every transparent material in a mesh for each chunk is a bottleneck for the rendering right now. If you can make transparent blocks in single mesh with an atlas, it will definitely improve the performance a lot.
I saw you disabled frustum culling on client side. It's fairly easy to calculate a bounding box for each chunk and add back the frustum culling. It will improves reduce rendering cost by 60% based on fov.