initialization-related bugfixes

metadata
Wenzel Jakob 2010-09-14 00:51:09 +02:00
parent 43baf60019
commit 59ff88d45a
4 changed files with 7 additions and 10 deletions

View File

@ -162,7 +162,7 @@ void GeometryConverter::convert(const fs::path &inputFile,
SLog(EError, "Unknown input format (must end in either .DAE, .ZAE or .OBJ)");
}
if (adjustmentFile.empty()) {
if (!adjustmentFile.empty()) {
SLog(EInfo, "Applying adjustments ..");
static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
DOMImplementationLS *impl = DOMImplementationRegistry::getDOMImplementation(gLS);

View File

@ -39,7 +39,7 @@ public:
Float N;
int depth;
inline GatherPoint() : N(0) {
inline GatherPoint() : weight(0.0f), flux(0.0f), emission(0.0f), N(0.0f) {
}
};

View File

@ -40,13 +40,13 @@ public:
int depth;
Point2i pos;
inline GatherPoint() : N(0) {
inline GatherPoint() : weight(0.0f), flux(0.0f), emission(0.0f), N(0.0f) {
}
};
StochasticProgressivePhotonMapIntegrator(const Properties &props) : Integrator(props) {
/* Initial photon query radius (0 = infer based on scene size and camera resolution) */
m_initialRadius = props.getFloat("initialRadius", .2);
m_initialRadius = props.getFloat("initialRadius", 0);
/* Alpha parameter from the paper (influences the speed, at which the photon radius is reduced) */
m_alpha = props.getFloat("alpha", .7);
/* Number of photons to shoot in each iteration */
@ -265,12 +265,12 @@ public:
#pragma omp parallel for schedule(dynamic)
for (int blockIdx = 0; blockIdx<(int) m_gatherBlocks.size(); ++blockIdx) {
std::vector<GatherPoint> &gatherPoints = m_gatherBlocks[blockIdx];
Spectrum flux, contrib;
float *target = m_bitmap->getFloatData();
for (size_t i=0; i<gatherPoints.size(); ++i) {
GatherPoint &gp = gatherPoints[i];
Float M, N = gp.N;
Spectrum flux, contrib;
if (gp.depth != -1) {
M = photonMap->estimateRadianceRaw(
@ -288,11 +288,8 @@ public:
gp.emission * proc->getShotPhotons() * M_PI * gp.radius*gp.radius)) * ratio;
gp.radius = gp.radius * std::sqrt(ratio);
gp.N = N + m_alpha * M;
contrib = gp.flux / ((Float) m_totalEmitted * gp.radius*gp.radius * M_PI);
}
contrib = gp.flux / ((Float) m_totalEmitted * gp.radius*gp.radius * M_PI);
Float r, g, b;
contrib.toLinearRGB(r, g, b);

View File

@ -181,7 +181,7 @@ struct clamp_neighbors_functor {
/* Irradiance interpolation functor */
struct irr_interp_functor {
irr_interp_functor(const Intersection &its, Float kappa, bool gradients) : its(its),
kappa(kappa), weightSum(0), gradients(gradients) {
kappa(kappa), weightSum(0), gradients(gradients), E(0.0f) {
}
void operator()(const IrradianceCache::Record *sample) {