From 096d2cf196eb9a69526298eb59b375eb8d54a5f1 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Thu, 21 Jul 2011 12:48:06 -0400 Subject: hybrid monte carlo render now distinguishes between the two different sides of each triangle. reduced the number of runs to average when propagating photons from each pixel in render.py from 5 to 1; the speed improvement outweighs any small improvement in the quality of the rendered image. --- src/photon.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/photon.h') diff --git a/src/photon.h b/src/photon.h index 69ecd34..11bcfc1 100644 --- a/src/photon.h +++ b/src/photon.h @@ -25,6 +25,8 @@ struct Photon struct State { + bool inside_to_outside; + float3 surface_normal; float refractive_index1, refractive_index2; @@ -78,6 +80,8 @@ __device__ int fill_state(State &s, Photon &p) // outside to inside material1 = materials[outer_material_index]; material2 = materials[inner_material_index]; + + s.inside_to_outside = false; } else { @@ -85,6 +89,8 @@ __device__ int fill_state(State &s, Photon &p) material1 = materials[inner_material_index]; material2 = materials[outer_material_index]; s.surface_normal = -s.surface_normal; + + s.inside_to_outside = true; } s.refractive_index1 = interp_property(p.wavelength, material1.refractive_index); -- cgit