Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1640 - in trunk/Engine: ImageTraversers Shadows
- Date: Wed, 15 Aug 2007 16:13:02 -0600 (MDT)
Author: boulos
Date: Wed Aug 15 16:13:02 2007
New Revision: 1640
Modified:
trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc
trunk/Engine/Shadows/HardShadows.cc
Log:
Adding option to blend old samples in the deadline
traverser (doesn't seem to look any better though).
Turning off SSE for the HardShadows code again (still
seems to have some bugs).
Modified: trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc Wed Aug 15
16:13:02 2007
@@ -122,6 +122,7 @@
int num_spp = 4;
for (int i = 0; i < kNumJitterLevels; i++) {
vector<string> args;
+ args.push_back("-nocheap");
args.push_back("-numberOfSamples");
ostringstream r;
@@ -245,7 +246,11 @@
converged = true;
double EndTime = CPUTime::currentSeconds();
double total_time = EndTime - StartFrameTime;
- cerr << "Took " << total_time << " seconds to refine to "<< (4 <<
kNumJitterLevels) <<" spp" << endl;
+ unsigned int total_samples = 1;
+ for (int i = 0; i < kNumJitterLevels; i++) {
+ total_samples *= 4;
+ }
+ cerr << "Took " << total_time << " seconds to refine to "<<
total_samples <<" spp" << endl;
}
}
}
@@ -400,6 +405,7 @@
break;
case 1024:
jitter_sampler = jitterSamplers[4];
+ break;
default:
throw SCIRun::InternalError("Expected either 4, 16, 64, 256, or 1024
spp", __FILE__, __LINE__);
break;
@@ -411,7 +417,7 @@
// packet.
if (xs < 1 || ys < 1) {
// Handle multiple packets per pixel.
- cerr << "Multiple packets per pixel (spp = " << samples_per_pixel <<
", newxmag = " << newxmag << ")\n";
+ //cerr << "Multiple packets per pixel (spp = " << samples_per_pixel
<< ", newxmag = " << newxmag << ")\n";
if (xs != ys) {
throw SCIRun::InternalError("Don't handle non-square refinement
yet",
__FILE__, __LINE__);
@@ -436,6 +442,29 @@
childtile->ymag = newymag;
computePriority(childtile, frag);
childtiles.push_back(childtile);
+
+#if BLEND_OLD_SAMPLES
+ int prev_xs = static_cast<int>(xpacketsize * xrefinementRatio *
newxmag);
+ int prev_ys = static_cast<int>(ypacketsize * yrefinementRatio *
newymag);
+
+ if (prev_xs < 1 && prev_ys < 1) {
+ Fragment prev_frag(Fragment::SquareShape, Fragment::ConstantEye);
+ prev_frag.setPixelSize(1, 1);
+ prev_frag.pixel[0][0] = tile->xstart;
+ prev_frag.pixel[1][0] = tile->ystart;
+ prev_frag.whichEye[0] = 0;
+ prev_frag.setSize(1);
+ image->get(prev_frag);
+ // TODO(boulos): Determine kOldAlpha according to refinement...
+ const float kOldAlpha = 0.2f; // 1/5 and 4/5
+ prev_frag.scaleColor(0, kOldAlpha);
+
+ frag.scaleColor(0, 1.f-kOldAlpha);
+ frag.addColor(0, prev_frag.getColor(0));
+ }
+#endif
+
+
image->set(frag);
} else {
for(int y = tile->ystart; y < tile->yend; y += ys){
Modified: trunk/Engine/Shadows/HardShadows.cc
==============================================================================
--- trunk/Engine/Shadows/HardShadows.cc (original)
+++ trunk/Engine/Shadows/HardShadows.cc Wed Aug 15 16:13:02 2007
@@ -19,6 +19,10 @@
using namespace Manta;
using std::cerr;
+#ifdef MANTA_SSE
+#undef MANTA_SSE
+#endif
+
ShadowAlgorithm* HardShadows::create(const vector<string>& args)
{
return new HardShadows(args);
- [Manta] r1640 - in trunk/Engine: ImageTraversers Shadows, boulos, 08/15/2007
Archive powered by MHonArc 2.6.16.