Broken frustum culling
This commit is contained in:
parent
85b7351688
commit
21d7e800c8
|
@ -312,15 +312,15 @@ void ChunkManager::updateRender(Camera* camera)
|
|||
{
|
||||
if(pChunk->shouldRender()) // Early flags check so we don't always have to do the frustum check...
|
||||
{
|
||||
// TODO: frustum culling
|
||||
//glm::vec3 pos = pChunk->getAbsolutePosition();
|
||||
//glm::mat4 model = glm::translate(glm::mat4(1.0f), pos);
|
||||
// TODO: fix frustum culling
|
||||
glm::vec3 pos = pChunk->getAbsolutePosition();
|
||||
glm::mat4 model = glm::translate(glm::mat4(1.0f), pos);
|
||||
|
||||
//camera->updateFrustum(model);
|
||||
//if(camera->frustumContainsBox(pos, pos + glm::vec3((float)CHUNK_SIZE)))
|
||||
//{
|
||||
camera->updateFrustum(model);
|
||||
if(camera->frustumContainsBox(glm::vec3(0.0f), glm::vec3((float)CHUNK_SIZE)) != 0)
|
||||
{
|
||||
m_chunkRenderQueue.push_back(pChunk);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue