the envmap luminaire is verified!
parent
7305768f61
commit
e379ffda42
Binary file not shown.
|
@ -2,8 +2,14 @@
|
||||||
to be tested for consistency. This is done using the
|
to be tested for consistency. This is done using the
|
||||||
testcase 'test_chisquare' -->
|
testcase 'test_chisquare' -->
|
||||||
<scene version="0.3.0">
|
<scene version="0.3.0">
|
||||||
<!-- Test the constant luminaire -->
|
<!-- Test the constant luminaire
|
||||||
<luminaire type="constant"/>
|
<luminaire type="constant"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Test the environment map luminaire -->
|
||||||
|
<luminaire type="envmap">
|
||||||
|
<string name="filename" value="data/tests/envmap.exr"/>
|
||||||
|
</luminaire>
|
||||||
|
|
||||||
<!-- Make sure that the scene actually contains something -->
|
<!-- Make sure that the scene actually contains something -->
|
||||||
<shape type="sphere"/>
|
<shape type="sphere"/>
|
||||||
|
|
|
@ -331,8 +331,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mismatch)
|
if (mismatch)
|
||||||
Log(EWarn, "Potential inconsistency: f/pdf=%s (sampled), f/pdf=%s (evaluated)",
|
Log(EWarn, "Potential inconsistency: f/pdf=%s (sampled), f/pdf=%s (evaluated), f=%s, pdf=%f, pdf2=%f",
|
||||||
value.toString().c_str(), value2.toString().c_str());
|
value.toString().c_str(), value2.toString().c_str(), Le.toString().c_str(), pdf, lRec.pdf);
|
||||||
|
|
||||||
#if defined(MTS_DEBUG_FP)
|
#if defined(MTS_DEBUG_FP)
|
||||||
disableFPExceptions();
|
disableFPExceptions();
|
||||||
|
@ -405,7 +405,6 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
// (the following assumes that the distribution has 1 parameter, e.g. exponent value)
|
// (the following assumes that the distribution has 1 parameter, e.g. exponent value)
|
||||||
chiSqr->dumpTables("test.m");
|
|
||||||
ChiSquare::ETestResult result = chiSqr->runTest(SIGNIFICANCE_LEVEL);
|
ChiSquare::ETestResult result = chiSqr->runTest(SIGNIFICANCE_LEVEL);
|
||||||
if (result == ChiSquare::EReject) {
|
if (result == ChiSquare::EReject) {
|
||||||
std::string filename = formatString("failure_%i.m", failureCount++);
|
std::string filename = formatString("failure_%i.m", failureCount++);
|
||||||
|
@ -542,25 +541,20 @@ public:
|
||||||
scene->initialize();
|
scene->initialize();
|
||||||
|
|
||||||
const std::vector<Luminaire *> luminaires = scene->getLuminaires();
|
const std::vector<Luminaire *> luminaires = scene->getLuminaires();
|
||||||
size_t thetaBins = 10, wiSamples = 20, failureCount = 0, testCount = 0;
|
size_t thetaBins = 10, failureCount = 0, testCount = 0;
|
||||||
ref<Sampler> sampler = static_cast<Sampler *> (PluginManager::getInstance()->
|
ref<Sampler> sampler = static_cast<Sampler *> (PluginManager::getInstance()->
|
||||||
createObject(MTS_CLASS(Sampler), Properties("independent")));
|
createObject(MTS_CLASS(Sampler), Properties("independent")));
|
||||||
|
|
||||||
ProgressReporter *progress = new ProgressReporter("Checking", wiSamples, NULL);
|
|
||||||
|
|
||||||
Log(EInfo, "Verifying luminaire sampling routines ..");
|
Log(EInfo, "Verifying luminaire sampling routines ..");
|
||||||
for (size_t i=0; i<luminaires.size(); ++i) {
|
for (size_t i=0; i<luminaires.size(); ++i) {
|
||||||
const Luminaire *luminaire = luminaires[i];
|
const Luminaire *luminaire = luminaires[i];
|
||||||
|
|
||||||
Log(EInfo, "Processing luminaire function model %s", luminaire->toString().c_str());
|
Log(EInfo, "Processing luminaire function model %s", luminaire->toString().c_str());
|
||||||
Log(EInfo, "Checking the model for %i incident directions", wiSamples);
|
|
||||||
progress->reset();
|
|
||||||
|
|
||||||
/* Test for a number of different incident directions */
|
|
||||||
for (size_t j=0; j<wiSamples; ++j) {
|
|
||||||
LuminaireAdapter adapter(luminaire, sampler);
|
LuminaireAdapter adapter(luminaire, sampler);
|
||||||
ref<ChiSquare> chiSqr = new ChiSquare(thetaBins, 2*thetaBins, wiSamples);
|
ref<ChiSquare> chiSqr = new ChiSquare(thetaBins, 2*thetaBins, 1);
|
||||||
chiSqr->setLogLevel(EDebug);
|
chiSqr->setLogLevel(EDebug);
|
||||||
|
chiSqr->dumpTables("test.m");
|
||||||
|
|
||||||
// Initialize the tables used by the chi-square test
|
// Initialize the tables used by the chi-square test
|
||||||
chiSqr->fill(
|
chiSqr->fill(
|
||||||
|
@ -580,11 +574,8 @@ public:
|
||||||
succeed();
|
succeed();
|
||||||
}
|
}
|
||||||
++testCount;
|
++testCount;
|
||||||
progress->update(j+1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Log(EInfo, "%i/%i luminaire checks succeeded", testCount-failureCount, testCount);
|
Log(EInfo, "%i/%i luminaire checks succeeded", testCount-failureCount, testCount);
|
||||||
delete progress;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue