Text archives Help
- From: sparker@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1857 - trunk/Engine/Renderers
- Date: Tue, 20 Nov 2007 00:07:49 -0700 (MST)
Author: sparker
Date: Tue Nov 20 00:07:49 2007
New Revision: 1857
Modified:
trunk/Engine/Renderers/KajiyaPathtracer.cc
Log:
Use maxComponent for russian roulette instead of luminance. Don't do RR on
first rays.
Modified: trunk/Engine/Renderers/KajiyaPathtracer.cc
==============================================================================
--- trunk/Engine/Renderers/KajiyaPathtracer.cc (original)
+++ trunk/Engine/Renderers/KajiyaPathtracer.cc Tue Nov 20 00:07:49 2007
@@ -1,4 +1,5 @@
// TODO
+// Need to determine light area and normal
// If single pixel, use a single accumulator
// Put background rays at end to make alignment easier - DO BACKGROUND RAYS
ALL AT ONCE!!!
// Try sorting after MC by direction/origin and do not sort by matl
@@ -174,13 +175,14 @@
}
// Russian roulette and collapse
- bool do_russian_roulette = true;
+ bool do_russian_roulette = (depth > 0);
if(do_russian_roulette){
Packet<Real> rr;
context.sample_generator->nextSeeds(context, rr, rays);
int newEnd = rays.end();
for(int i=rays.begin();i<newEnd;i++){
- if(rr.get(i) > reflectance.get(i).luminance()){
+ double max = reflectance.get(i).maxComponent();
+ if(rr.get(i) > max){
// Kill it by swapping with the last ray
// We may not need to move origin/direction back....
--newEnd;
@@ -223,7 +225,7 @@
--i;
} else {
- Real scale = 1./reflectance.get(i).luminance();
+ Real scale = Real(1.)/max;
for(int j=0;j<3;j++)
reflectance.colordata[j][i] *= scale;
for(int j=0;j<3;j++)
- [Manta] r1857 - trunk/Engine/Renderers, sparker, 11/20/2007
Archive powered by MHonArc 2.6.16.