fixed bug in real-time occlusion culling that caused octree nodes and flares to disappear when they should be visible
This commit is contained in:
@@ -228,7 +228,7 @@ void KRCamera::renderFrame(float deltaTime, GLint renderBufferWidth, GLint rende
|
|||||||
|
|
||||||
|
|
||||||
// Render the geometry
|
// Render the geometry
|
||||||
scene.render(this, m_viewport.getVisibleBounds(), m_viewport, KRNode::RENDER_PASS_FORWARD_OPAQUE, false);
|
scene.render(this, m_viewport.getVisibleBounds(), m_viewport, KRNode::RENDER_PASS_FORWARD_OPAQUE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----====---- Sky Box ----====----
|
// ----====---- Sky Box ----====----
|
||||||
|
|||||||
@@ -286,6 +286,10 @@ void KRLight::render(KRCamera *pCamera, std::vector<KRLight *> &lights, const KR
|
|||||||
if(m_flareTexture.size() && m_flareSize > 0.0f) {
|
if(m_flareTexture.size() && m_flareSize > 0.0f) {
|
||||||
|
|
||||||
if(m_occlusionQuery) {
|
if(m_occlusionQuery) {
|
||||||
|
GLuint hasBeenTested = 0;
|
||||||
|
while(!hasBeenTested) {
|
||||||
|
GLDEBUG(glGetQueryObjectuivEXT(m_occlusionQuery, GL_QUERY_RESULT_AVAILABLE_EXT, &hasBeenTested)); // FINDME, HACK!! This needs to be replaced with asynchonous logic
|
||||||
|
}
|
||||||
GLuint params = 0;
|
GLuint params = 0;
|
||||||
GLDEBUG(glGetQueryObjectuivEXT(m_occlusionQuery, GL_QUERY_RESULT_EXT, ¶ms));
|
GLDEBUG(glGetQueryObjectuivEXT(m_occlusionQuery, GL_QUERY_RESULT_EXT, ¶ms));
|
||||||
GLDEBUG(glDeleteQueriesEXT(1, &m_occlusionQuery));
|
GLDEBUG(glDeleteQueriesEXT(1, &m_occlusionQuery));
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ void KRScene::render(KROctreeNode *pOctreeNode, std::map<KRAABB, int> &visibleBo
|
|||||||
if(bOcclusionResultsPass) {
|
if(bOcclusionResultsPass) {
|
||||||
// ----====---- Occlusion results pass ----====----
|
// ----====---- Occlusion results pass ----====----
|
||||||
if(pOctreeNode->m_occlusionTested) {
|
if(pOctreeNode->m_occlusionTested) {
|
||||||
|
GLuint hasBeenTested = 0;
|
||||||
|
while(!hasBeenTested) {
|
||||||
|
GLDEBUG(glGetQueryObjectuivEXT(pOctreeNode->m_occlusionQuery, GL_QUERY_RESULT_AVAILABLE_EXT, &hasBeenTested)); // FINDME, HACK!! This needs to be replaced with asynchonous logic
|
||||||
|
}
|
||||||
|
|
||||||
GLuint params = 0;
|
GLuint params = 0;
|
||||||
GLDEBUG(glGetQueryObjectuivEXT(pOctreeNode->m_occlusionQuery, GL_QUERY_RESULT_EXT, ¶ms));
|
GLDEBUG(glGetQueryObjectuivEXT(pOctreeNode->m_occlusionQuery, GL_QUERY_RESULT_EXT, ¶ms));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user