Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r452 - branches/itanium2/Model/Materials
- Date: Thu, 28 Jul 2005 03:53:16 -0600 (MDT)
Author: boulos
Date: Thu Jul 28 03:53:15 2005
New Revision: 452
Modified:
branches/itanium2/Model/Materials/Dielectric.cc
Log:
Hopefully the last fix to the beer's law logic.
Modified: branches/itanium2/Model/Materials/Dielectric.cc
==============================================================================
--- branches/itanium2/Model/Materials/Dielectric.cc (original)
+++ branches/itanium2/Model/Materials/Dielectric.cc Thu Jul 28 03:53:15
2005
@@ -241,16 +241,17 @@
// compute their results
for (int i = 0; i < rays.getSize(); i++)
{
+ RayPacket::Element& e = rays.get(i);
if (internally_reflected[i])
{
RayPacket::Element& r = internal_rays.get(internal_counter);
- if ( !from_outsides[i] )
+ if ( !from_outsides[i] ) // the original ray rays.get(i) was
leaving
{
// These two Beer's law calculations are equivalent, but
// one may be faster than the other
- //(*r.color) *=
sigma_a_values[i].Log().attenuate(r.hitInfo.minT());
- (*r.color) *= sigma_a_values[i].Pow(r.hitInfo.minT());
+ //(*r.color) *=
sigma_a_values[i].Log().attenuate(e.hitInfo.minT());
+ (*r.color) *= sigma_a_values[i].Pow(e.hitInfo.minT());
}
rays.setResult(i, *r.color);
internal_counter++;
@@ -260,12 +261,12 @@
RayPacket::Element& refl = reflected_rays.get(branch_counter);
RayPacket::Element& refr = refracted_rays.get(branch_counter);
- if ( from_outsides[i] )
+ if ( !from_outsides[i] )
{
// These two Beer's law calculations are equivalent, but
// one may be faster than the other
- //(*refr.color) *=
sigma_a_values[i].Log().attenuate(refr.hitInfo.minT());
- (*refr.color) *= sigma_a_values[i].Pow(refr.hitInfo.minT());
+ //(*refr.color) *=
sigma_a_values[i].Log().attenuate(e.hitInfo.minT());
+ (*refr.color) *= sigma_a_values[i].Pow(e.hitInfo.minT());
}
rays.setResult(i, (Color::white()*fresnel_coeffs[i])*(*refl.color)
+
(Color::white()*(1.-fresnel_coeffs[i]))*(*refr.color) );
- [MANTA] r452 - branches/itanium2/Model/Materials, boulos, 07/28/2005
Archive powered by MHonArc 2.6.16.