Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2086 - in trunk: Interface Model/Groups


Chronological Thread 
  • From: "Solomon Boulos" <boulos@cs.utah.edu>
  • To: manta@sci.utah.edu
  • Subject: [Manta] r2086 - in trunk: Interface Model/Groups
  • Date: Sat, 16 Feb 2008 13:52:46 -0700 (MST)

Author: boulos
Date: Sat Feb 16 13:52:45 2008
New Revision: 2086

Modified:
   trunk/Interface/Task.h
   trunk/Model/Groups/DynBVH.cc
Log:
Interface/Task.h

 Doubling the scratchpad size again to make room for 3 axis, 16
 samples BVH build (48 bboxes + ints)

Model/Groups/DynBVH.cc

 Moving the number of samples taken for the build into one convient
 spot towards the top of the file. Setting this number higher than 8
 actually strongly reduces rendering performance for both the bunny
 and the fairy (time to investigate).


Modified: trunk/Interface/Task.h
==============================================================================
--- trunk/Interface/Task.h      (original)
+++ trunk/Interface/Task.h      Sat Feb 16 13:52:45 2008
@@ -16,7 +16,7 @@
     typedef CallbackBase_1Data<Task*> TaskCallback;
     Task(TaskCallback* task_function);
 
-    static const unsigned int MaxScratchpadSize = 1024;
+    static const unsigned int MaxScratchpadSize = 2048;
 
     unsigned int task_id;
     TaskList* task_list;

Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc        (original)
+++ trunk/Model/Groups/DynBVH.cc        Sat Feb 16 13:52:45 2008
@@ -24,6 +24,9 @@
 // these constants control the SAH cost model
 const float BVH_C_isec = 10.f;
 const float BVH_C_trav = 10.f;
+// NOTE(boulos): Setting this to 16 for either bunny or fairy f100.obj
+// leads to lower rendering performance...
+const int BVH_num_samples = 8;
 
 #include <Model/Groups/Mesh.h>
 void WriteMeshSorted(Group* group, std::vector<int> ids, const char* 
filename) {
@@ -749,7 +752,7 @@
   // TODO(boulos): Determine a good value for this leads to low
   // contention and good parallel speedup when scenes are large
   // enough.
-  const unsigned int kMinObjects = 2048;
+  const unsigned int kMinObjects = 4096;
   if (node.isLeaf() || num_objects < kMinObjects) {
     PreprocessContext preprocess_context(context.manta_interface,
                                          context.proc,
@@ -1043,7 +1046,7 @@
     int count;
   };
 
-  const int num_samples = 8;
+  const int num_samples = BVH_num_samples;
   SampleBin bins[3][num_samples];
 
   Vector min_point = overall_bounds.getMin();
@@ -1114,7 +1117,7 @@
                                           int objectBegin,
                                           int objectEnd,
                                           UpdateContext context) {
-  const int num_samples = 8;
+  const int num_samples = BVH_num_samples;
   struct SampleBin {
     SampleBin() { count = 0; }
     BBox bounds;
@@ -1235,7 +1238,7 @@
 void DynBVH::parallelTopDownBuild(Task* task, int nodeID, int objectBegin, 
int objectEnd, UpdateContext context) {
   //cerr << MANTA_FUNC << "(nodeId = " << nodeID << ", objectBegin = " << 
objectBegin << ", objectEnd = " << objectEnd << ")\n";
   int num_objects = objectEnd - objectBegin;
-  const int kSmallObjects = 2048;
+  const int kSmallObjects = 4096;
   PreprocessContext preprocess_context(context.manta_interface,
                                        context.proc,
                                        context.num_procs,
@@ -1472,21 +1475,23 @@
   };
 
 
-  const int num_samples = 8;
+  const int num_samples = BVH_num_samples;
   SampleBin bins[3][num_samples];
 
   Vector min_point = overall_bounds.getMin();
   Vector max_point = overall_bounds.getMax();
   Vector width = max_point - min_point;
+  //Vector scale((num_samples/width[0]) * .999f,
+  //           (num_samples/width[1]) * .999f,
+  //           (num_samples/width[2]) * .999f);
 
   for (int i = objBegin; i < objEnd; i++) {
     BBox& obj_box = obj_bounds[object_ids[i]];
     Vector& obj_centroid = obj_centroids[object_ids[i]];
     for (int axis = 0; axis < 3; axis++) {
       // Sample bin is where this position would fall to the left
-      // int(num_samples * (centroid[axis] - min_point[axis])/width[axis])
-      int which_bin = static_cast<int>
-        (num_samples * (obj_centroid[axis] - min_point[axis])/width[axis]);
+      int which_bin = int(num_samples * (obj_centroid[axis] - 
min_point[axis])/width[axis]);
+      //int which_bin = int((obj_centroid[axis] - min_point[axis]) * 
scale[axis]);
 
       if (width[axis] == 0)
         which_bin = 0;




  • [Manta] r2086 - in trunk: Interface Model/Groups, Solomon Boulos, 02/16/2008

Archive powered by MHonArc 2.6.16.

Top of page