New way of handling lights and materials.

This commit is contained in:
2017-01-01 20:57:35 -04:00
parent 2b1a9ed819
commit c78a8d284f
13 changed files with 141 additions and 108 deletions

View File

@@ -21,12 +21,14 @@ public:
float m_fov;
float m_a_ratio;
Tracer();
Tracer(): m_h(480), m_w(640), m_fov(90.0f), m_a_ratio(640.0f / 480.0f) { }
Tracer(int h, int w, float fov);
Tracer(int h, int w, float fov): m_h(h), m_w(w), m_fov(fov) {
m_a_ratio = static_cast<float>(w) / static_cast<float>(h);
};
vec2 sample_pixel(int i, int j) const;
vec3 trace_ray(Ray & r, vector<Figure *> & f, vector<Light *> & l, unsigned int rec_level) const;
vec3 trace_ray(Ray & r, vector<Figure *> & v_figures, vector<Light *> & v_lights, unsigned int rec_level) const;
};
#endif