renderer: perform frustum culling only if chunk has vertices
parent
880c634be0
commit
353ef37186
|
@ -149,6 +149,7 @@ namespace renderer{
|
||||||
if(dist <= static_cast<float>(RENDER_DISTANCE)){
|
if(dist <= static_cast<float>(RENDER_DISTANCE)){
|
||||||
if(!c->getState(Chunk::CHUNK_STATE_MESH_LOADED)) continue;
|
if(!c->getState(Chunk::CHUNK_STATE_MESH_LOADED)) continue;
|
||||||
|
|
||||||
|
if(c->numVertices > 0){
|
||||||
// Increase total vertex count
|
// Increase total vertex count
|
||||||
vertices += c->numVertices;
|
vertices += c->numVertices;
|
||||||
|
|
||||||
|
@ -178,8 +179,6 @@ namespace renderer{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!out)
|
if (!out)
|
||||||
{
|
|
||||||
if(c->numVertices > 0)
|
|
||||||
{
|
{
|
||||||
theShader->setMat4("model", model);
|
theShader->setMat4("model", model);
|
||||||
theShader->setMat4("view", theCamera.getView());
|
theShader->setMat4("view", theCamera.getView());
|
||||||
|
|
Loading…
Reference in New Issue