Sfoglia il codice sorgente

Fixed frustum culling in new renderer

Ivan Safrin 10 anni fa
parent
commit
77b21ddac9
2 ha cambiato i file con 5 aggiunte e 6 eliminazioni
  1. 3 1
      src/core/PolyCamera.cpp
  2. 2 5
      src/core/PolyScene.cpp

+ 3 - 1
src/core/PolyCamera.cpp

@@ -163,7 +163,9 @@ void Camera::buildFrustumPlanes() {
 	Matrix4 mvp;
 	Number t;
 
-   // mv = renderer->getModelviewMatrix();
+    Matrix4 projectionMatrix = createProjectionMatrix();
+    
+    mv = getConcatenatedMatrix().Inverse();
 
     //
     // Concatenate the projection matrix and the model-view matrix to produce 

+ 2 - 5
src/core/PolyScene.cpp

@@ -290,17 +290,14 @@ void Scene::Render(Camera *targetCamera, RenderBuffer *targetFramebuffer) {
         drawBuffer->lights[drawBuffer->lights.size()-1].direction = direction;
 	}	
 		
-    	/*
+    
     if(_doVisibilityChecking) {
         targetCamera->buildFrustumPlanes();
         setEntityVisibility(&rootEntity, targetCamera);
     }
-         */
-	rootEntity.transformAndRender(drawBuffer, NULL);
 
-    
+	rootEntity.transformAndRender(drawBuffer, NULL);
     renderer->processDrawBuffer(drawBuffer);
-    
 }