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)"); SLog(EError, "Unknown input format (must end in either .DAE, .ZAE or .OBJ)");
} }
if (adjustmentFile.empty()) { if (!adjustmentFile.empty()) {
SLog(EInfo, "Applying adjustments .."); SLog(EInfo, "Applying adjustments ..");
static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull }; static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
DOMImplementationLS *impl = DOMImplementationRegistry::getDOMImplementation(gLS); DOMImplementationLS *impl = DOMImplementationRegistry::getDOMImplementation(gLS);

View File

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

View File

@ -181,7 +181,7 @@ struct clamp_neighbors_functor {
/* Irradiance interpolation functor */ /* Irradiance interpolation functor */
struct irr_interp_functor { struct irr_interp_functor {
irr_interp_functor(const Intersection &its, Float kappa, bool gradients) : its(its), 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) { void operator()(const IrradianceCache::Record *sample) {