Right now, all world meshes sharing the same material are grouped into one mesh. This is not only not ideal for culling since geometry that's not visible is still sent to the GPU, it also means that a lot of lights can touch the same mesh, requiring that every mesh has to do the calculations for a lot of lights. It would be beneficial to split the meshes into pieces which are actually grouped together. A good start is just separating each loose "island" into a separate mesh.
TODOs:
[x] Build meshes using the bsp tree
[x] Merge all textures into one Texture2DArray and index the appropriate texture using a third uv coordinate
Right now, all world meshes sharing the same material are grouped into one mesh. This is not only not ideal for culling since geometry that's not visible is still sent to the GPU, it also means that a lot of lights can touch the same mesh, requiring that every mesh has to do the calculations for a lot of lights. It would be beneficial to split the meshes into pieces which are actually grouped together. A good start is just separating each loose "island" into a separate mesh.
TODOs: