summaryrefslogtreecommitdiff
path: root/src/photon.h
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-07-21 12:48:06 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-07-21 12:48:06 -0400
commit096d2cf196eb9a69526298eb59b375eb8d54a5f1 (patch)
treeaf1e0de739f5c1317665ffa6b7052d733c2fee38 /src/photon.h
parent6965233876421b43acac15c03cc3e6c858b0b6b0 (diff)
downloadchroma-096d2cf196eb9a69526298eb59b375eb8d54a5f1.tar.gz
chroma-096d2cf196eb9a69526298eb59b375eb8d54a5f1.tar.bz2
chroma-096d2cf196eb9a69526298eb59b375eb8d54a5f1.zip
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.
Diffstat (limited to 'src/photon.h')
-rw-r--r--src/photon.h6
1 files changed, 6 insertions, 0 deletions
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);