Skip to content
Snippets Groups Projects
Commit 8caafb54 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added extinction coefficient

parent 64c56214
No related branches found
No related tags found
No related merge requests found
......@@ -46,3 +46,7 @@ int ray::get_source() const{
double ray::get_amplitude() const{
return amplitude;
}
double ray::get_amplitude_at(double t) const{
return amplitude*std::exp(-12600.*extinction_coeff*(at(t) - orig).length());
}
......@@ -6,7 +6,7 @@
class ray{
public:
ray();
ray(const point3& origin, const vec3& direction, double amplitude, double opl, double refractive_index, int phase_flips, int max_bounces);
ray(const point3& origin, const vec3& direction, double amplitude, double opl, double refractive_index, double extinction_coeff, int phase_flips, int max_bounces);
point3 origin() const;
vec3 direction() const;
......@@ -22,12 +22,14 @@ public:
int get_source() const;
double get_amplitude() const;
double get_amplitude_at(double t) const;
private:
point3 orig;
vec3 dir;
double optical_path; //optical path since pixel
double refractive_index; //refractive index of next straight path
double extinction_coeff; //extinction coeff of next straight path
int phase_flips; //number of phase flips accumulated so far (from refl.)
int source; //information about the source the ray ended at (0 for none)
int bounces_left; //number of bounces the ray can perform
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment