[Bf-blender-cvs] [8ebb552] master: Fix T40257: Frustum culling not working properly

Mitchell Stokes noreply at git.blender.org
Thu Jan 8 05:48:12 CET 2015


Commit: 8ebb552a9551abcb3d013b192a0dc9c2ea6f2bcc
Author: Mitchell Stokes
Date:   Wed Jan 7 20:41:07 2015 -0800
Branches: master
https://developer.blender.org/rB8ebb552a9551abcb3d013b192a0dc9c2ea6f2bcc

Fix T40257: Frustum culling not working properly

Instead of getting fancy this time, we'll just use Mahalin's simpler
fix. This may have slight performance impacts, but it is a lot simpler
than the previous fix and shouldn't cause as many bugs.

===================================================================

M	source/gameengine/Ketsji/KX_Scene.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index d8f983b..b6fd69f 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1502,6 +1502,15 @@ void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int
 	bool dbvt_culling = false;
 	if (m_dbvt_culling) 
 	{
+		/* Reset KX_GameObject m_bCulled to true before doing culling
+		 * since DBVT culling will only set it to false.
+		 * This is similar to what RAS_BucketManager does for RAS_MeshSlot culling.
+		 */
+		for (int i = 0; i < m_objectlist->GetCount(); i++) {
+			KX_GameObject *gameobj = static_cast<KX_GameObject*>(m_objectlist->GetValue(i));
+			gameobj->SetCulled(true);
+		}
+
 		// test culling through Bullet
 		MT_Vector4 planes[6];
 		// get the clip planes




More information about the Bf-blender-cvs mailing list