Files
PhotonMF/tracer.hpp

38 lines
679 B
C++
Raw Normal View History

2016-12-26 15:41:29 -04:00
#pragma once
#ifndef TRACER_HPP
#define TRACER_HPP
#include <vector>
#include <glm/glm.hpp>
#include "figure.hpp"
#include "light.hpp"
#include "ray.hpp"
using std::vector;
using glm::vec2;
2017-01-02 02:39:24 -04:00
using glm::vec3;
2017-01-05 17:59:04 -04:00
2017-01-12 13:03:29 -04:00
extern const float BIAS;
2017-01-05 17:59:04 -04:00
extern const vec3 BCKG_COLOR;
2016-12-26 15:41:29 -04:00
class Tracer {
public:
2017-01-12 13:03:29 -04:00
unsigned int m_max_depth;
2016-12-26 15:41:29 -04:00
2017-01-12 17:23:11 -04:00
Tracer(): m_max_depth(5) { }
2016-12-27 15:26:49 -04:00
2017-01-12 17:23:11 -04:00
Tracer(unsigned int max_depth): m_max_depth(max_depth) { }
2016-12-26 15:41:29 -04:00
2017-01-05 17:59:04 -04:00
virtual ~Tracer() { }
virtual vec3 trace_ray(Ray & r, vector<Figure *> & v_figures, vector<Light *> & v_lights, unsigned int rec_level) const = 0;
2017-01-05 06:16:14 -04:00
2017-01-05 17:59:04 -04:00
protected:
float fresnel(const vec3 & i, const vec3 & n, const float ir1, const float ir2) const;
2016-12-26 15:41:29 -04:00
};
#endif