renderer: perform frustum culling only if chunk has vertices

pull/10/head
EmaMaker 2023-10-03 21:35:50 +02:00
parent 880c634be0
commit 353ef37186
1 changed files with 24 additions and 25 deletions

View File

@ -149,6 +149,7 @@ namespace renderer{
if(dist <= static_cast<float>(RENDER_DISTANCE)){
if(!c->getState(Chunk::CHUNK_STATE_MESH_LOADED)) continue;
if(c->numVertices > 0){
// Increase total vertex count
vertices += c->numVertices;
@ -178,8 +179,6 @@ namespace renderer{
}
if (!out)
{
if(c->numVertices > 0)
{
theShader->setMat4("model", model);
theShader->setMat4("view", theCamera.getView());