Text archives Help
- From: "Solomon Boulos" <boulos@cs.utah.edu>
- To: manta@sci.utah.edu
- Subject: [Manta] r2137 - in trunk: Core/Util Model/Groups
- Date: Fri, 29 Feb 2008 15:41:53 -0700 (MST)
Author: boulos
Date: Fri Feb 29 15:41:51 2008
New Revision: 2137
Modified:
trunk/Core/Util/Args.cc
trunk/Model/Groups/DynBVH.cc
Log:
Core/Util/Args.cc
Fixing unitialized warning messages when compiling with aggressive
inlining enabled.
Model/Groups/DynBVH.cc
Huge bug fix for approximate SAH build. The sample_position was being
set to the start of the bin instead of the end of the bin. Rendering
performance increase of approximately 25% for the bunny w/o shadows
and now going to 16 vs 8 samples doesn't decrease performance.
Modified: trunk/Core/Util/Args.cc
==============================================================================
--- trunk/Core/Util/Args.cc (original)
+++ trunk/Core/Util/Args.cc Fri Feb 29 15:41:51 2008
@@ -23,17 +23,17 @@
{
return getArg<long>(i, args, result);
}
-
+
bool getIntArg(size_t& i, const vector<string>& args, int& result)
{
return getArg<int>(i, args, result);
}
-
+
bool getDoubleArg(size_t& i, const vector<string>& args, double& result)
{
return getArg<double>(i, args, result);
}
-
+
// Parse an argument of the form NxM, where N and M are integers
bool getResolutionArg(size_t& i, const vector<string>& args, int& xres,
int& yres)
{
@@ -65,11 +65,14 @@
xres = tmpxres;
yres = tmpyres;
return true;
- }
+ }
bool getVectorArg(size_t& i, const vector<string>& args, Vector& v)
{
- double x,y,z;
+ // NOTE(boulos): Quieting warnings.
+ double x = 0.;
+ double y = 0.;
+ double z = 0.;
if(!getDoubleArg(i, args, x))
return false;
if(!getDoubleArg(i, args, y)){
@@ -91,7 +94,9 @@
return false;
}
if (name == "RGB8" || name == "RGBfloat") {
- ColorComponent r, g, b;
+ ColorComponent r(0);
+ ColorComponent g(0);
+ ColorComponent b(0);
if (!getArg<ColorComponent>(i, args, r)) {
return false;
}
@@ -188,7 +193,7 @@
#include <iostream>
using namespace std;
-namespace Manta {
+namespace Manta {
void parseArgs(const string& input, vector<string>& args) {
if (arg_debug) cout << "input = ("<<input.length()<<")("<<input<<")\n";
int len = (int)input.length();
@@ -241,5 +246,5 @@
start = end+1;
}
}
-
+
}
Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc (original)
+++ trunk/Model/Groups/DynBVH.cc Fri Feb 29 15:41:51 2008
@@ -24,8 +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...
+// NOTE(boulos): In Ingo's paper he says 16 works better than 8, but
+// I'm not sure for which models yet. For bunny it makes no
+// difference.
const int BVH_num_samples = 8;
#define LONGEST_AXIS 0
@@ -1271,8 +1272,9 @@
// Found new best cost
best_cost.cost = cost;
best_cost.axis = axis;
+ // NOTE(boulos): The position we want is the end of the bin, not the
start
float sample_position =
- (min_point[axis] +
width[axis]*(static_cast<float>(i)/num_samples));
+ (min_point[axis] +
width[axis]*(static_cast<float>(i+1)/num_samples));
best_cost.position = sample_position;
best_cost.num_left = left_counts[i];
best_cost.num_right = right_counts[i];
@@ -1571,17 +1573,7 @@
best_cost.position = FLT_MAX;
best_cost.event = -1;
- // TODO(boulos): Avoid recomputing overall bounds for sample
- // positions by passing in from parent.
-#if 0
- BBox overall_bounds;
- for (int i = objBegin; i < objEnd; i++) {
- overall_bounds.extendByBox(obj_bounds[object_ids[i]]);
- }
-#else
BBox& overall_bounds = nodes[nodeID].bounds;
-#endif
-
float inv_overall_area = 1.f/overall_bounds.computeArea();
struct SampleBin {
@@ -1673,8 +1665,9 @@
// Found new best cost
best_cost.cost = cost;
best_cost.axis = axis;
+ // NOTE(boulos): The position we want is the end of the bin, not the
start
float sample_position =
- (min_point[axis] +
width[axis]*(static_cast<float>(i)/num_samples));
+ (min_point[axis] +
width[axis]*(static_cast<float>(i+1)/num_samples));
best_cost.position = sample_position;
best_cost.num_left = left_counts[i];
best_cost.num_right = right_counts[i];
- [Manta] r2137 - in trunk: Core/Util Model/Groups, Solomon Boulos, 02/29/2008
Archive powered by MHonArc 2.6.16.