Skip to content
Permalink
Browse files

Fix for a volumetric boundary alpha issue on SPPM integrator.

Like to 'David Bluecame' fix, but a bit different because SPPM use a own render tile function.
  • Loading branch information...
povmaniaco committed Apr 8, 2015
1 parent 5fa8f7e commit 6f0fdafa4daf2469a020864ce3e7015459513314
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/integrators/sppm.cc
@@ -158,12 +158,16 @@ bool SPPM::renderTile(renderArea_t &a, int n_samples, int offset, bool adaptive,
int index = i*camera->resX() + j;
HitPoint &hp = hitPoints[index];

GatherInfo gInfo = traceGatherRay(rstate, c_ray, hp);
GatherInfo gInfo = traceGatherRay(rstate, c_ray, hp); // L_o
gInfo.photonFlux *= scene->volIntegrator->transmittance(rstate, c_ray);

gInfo.constantRandiance *= scene->volIntegrator->transmittance(rstate, c_ray);
gInfo.constantRandiance += scene->volIntegrator->integrate(rstate, c_ray); // Now using it to simulate for volIntegrator not using PPM, need more tests
hp.constantRandiance += gInfo.constantRandiance; // accumalate the constant randiance for later useage.
//needed fix for a volumetric boundary alpha issue because
// when col.A = T.A * L_o.A + L_v.A, col.A amount is > 1.0
colorA_t volTransmitt = scene->volIntegrator->transmittance(rstate, c_ray);
colorA_t volIntegrate = scene->volIntegrator->integrate(rstate, c_ray); // Now using it to simulate for volIntegrator not using PPM, need more tests
volIntegrate.A = 1.f - volTransmitt.A;
gInfo.constantRandiance *= volTransmitt; // T
gInfo.constantRandiance += volIntegrate; // L_v
hp.constantRandiance += gInfo.constantRandiance; // accumulate the constant radiance for later usage.

// progressive refinement
const float _alpha = 0.7f; // another common choice is 0.8, seems not changed much.

1 comment on commit 6f0fdaf

@DavidBluecame

This comment has been minimized.

Copy link
Member

commented on 6f0fdaf Apr 11, 2015

Thank you very much, povmaniaco!! :-)

I've included your fix and some other changes in a Windows 64bit experimental version, just in case you want to take a look. Please see: http://www.yafaray.org/community/forum/viewtopic.php?p=31038#p31038

Please sign in to comment.
You can’t perform that action at this time.