Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2246 - in trunk: . Model/Groups Model/Readers


Chronological Thread 
  • From: "Solomon Boulos" <boulos@cs.utah.edu>
  • To: manta@sci.utah.edu
  • Subject: [Manta] r2246 - in trunk: . Model/Groups Model/Readers
  • Date: Sun, 4 May 2008 22:08:08 -0600 (MDT)

Author: boulos
Date: Sun May  4 22:08:06 2008
New Revision: 2246

Modified:
   trunk/CMakeLists.txt
   trunk/Model/Groups/DynBVH.cc
   trunk/Model/Readers/CMakeLists.txt
   trunk/Model/Readers/UDAReader-stub.cc
Log:
CMakeLists.txt
Model/Readers/CMakeLists.txt
Model/Readers/UDAReader-stub.cc

 UDAReader was broken for both the stub and non-stub version... (does
 anyone use Manta anymore?).

 UDAReader non-stub needs to link against ZLIB.

 UDAReader stub needed a signature update.

Model/Groups/DynBVH.cc

 Also fixing a bug in BVH build that I introduced a while back (sweep
 build can't use partitionObjects based on position, it must redo the
 sweep)


Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt        (original)
+++ trunk/CMakeLists.txt        Sun May  4 22:08:06 2008
@@ -82,6 +82,8 @@
 INCLUDE (${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibXML2.cmake)
 # Find Threads
 INCLUDE (${CMAKE_ROOT}/Modules/FindThreads.cmake)
+# Find ZLib
+INCLUDE (${CMAKE_ROOT}/Modules/FindZLIB.cmake)
 
 
###############################################################################
 
###############################################################################

Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc        (original)
+++ trunk/Model/Groups/DynBVH.cc        Sun May  4 22:08:06 2008
@@ -21,7 +21,7 @@
 using namespace Manta;
 using std::cerr;
 
-#define TEST_MASKS 0
+#define TEST_MASKS 1
 // these constants control the SAH cost model
 const float BVH_C_isec = 10.f;
 const float BVH_C_trav = 10.f;
@@ -1936,18 +1936,21 @@
   output_axis = best_cost.axis;
   if ( output_axis != -1 ) {
     // write out object ids [objBegin,objEnd) in appropriate order
-    int middle = partitionObjects(objBegin, objEnd, best_cost.axis, 
best_cost.position);
-    if (middle == objBegin || middle == objEnd) {
-      // Splitting didn't find a valid split, split in the middle unless
-      // we have too few
-      const int kMinObjects = 3;
-      if (num_objects < kMinObjects) {
-        output_axis = -1;
-        return 0;
-      }
-      middle = objBegin + num_objects / 2;
+    // NOTE(boulos): Because the way the sweep works, we can't just
+    // use the position and partitionObjects
+    std::vector<BVHSAHEvent> events;
+    for ( int i = objBegin; i < objEnd; i++ ) {
+      BVHSAHEvent new_event;
+      new_event.position = obj_centroids[object_ids[i]][output_axis];
+      new_event.obj_id   = object_ids[i];
+      events.push_back(new_event);
     }
-    return middle;
+
+    std::sort(events.begin(),events.end(),CompareBVHSAHEvent());
+    for (int i = objBegin; i < objEnd; i++) {
+      object_ids[i] = events[i-objBegin].obj_id;
+    }
+    return objBegin + best_cost.event;
   }
 
   return 0; // making a leaf anyway

Modified: trunk/Model/Readers/CMakeLists.txt
==============================================================================
--- trunk/Model/Readers/CMakeLists.txt  (original)
+++ trunk/Model/Readers/CMakeLists.txt  Sun May  4 22:08:06 2008
@@ -10,17 +10,22 @@
   Readers/UDAReader.h
   )
 
-IF (LIBXML2_INCLUDE)
+IF (LIBXML2_INCLUDE AND ZLIB_FOUND)
      SET (Manta_Readers_SRCS ${Manta_Readers_SRCS}
           Readers/UDAReader.cc
          )
      INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE})
-ELSE (LIBXML2_INCLUDE)
+     INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+SET(Manta_Model_extra_libs ${Manta_Model_extra_libs}
+    ${ZLIB_LIBRARY}         
+    )
+
+ELSE (LIBXML2_INCLUDE AND ZLIB_FOUND)
    SET (Manta_Readers_SRCS ${Manta_Readers_SRCS}
           Readers/UDAReader-stub.cc
          )
 
-ENDIF (LIBXML2_INCLUDE)
+ENDIF (LIBXML2_INCLUDE AND ZLIB_FOUND)
 
 
 # Apple places malloc.h in /usr/include/malloc/malloc.h

Modified: trunk/Model/Readers/UDAReader-stub.cc
==============================================================================
--- trunk/Model/Readers/UDAReader-stub.cc       (original)
+++ trunk/Model/Readers/UDAReader-stub.cc       Sun May  4 22:08:06 2008
@@ -3,7 +3,7 @@
 using namespace Manta;
 using namespace std;
 
-void UDAReader::readUDA(string directory)
+void UDAReader::readUDA(string directory, string)
 {
     cerr << "UDAReader compiled without libxml, please link libxml2 and 
recompile Manta\n";
 }




  • [Manta] r2246 - in trunk: . Model/Groups Model/Readers, Solomon Boulos, 05/04/2008

Archive powered by MHonArc 2.6.16.

Top of page