diff options
Diffstat (limited to 'src/photon.h')
-rw-r--r-- | src/photon.h | 6 |
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); |