Add max_depth parameter
This commit is contained in:
parent
2c23fb819e
commit
3a5c6cddf9
2 changed files with 8 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
Scene::Scene()
|
Scene::Scene()
|
||||||
: width(640), height(480),
|
: width(640), height(480),
|
||||||
|
max_depth(5),
|
||||||
pixels(NULL)
|
pixels(NULL)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,17 @@ public:
|
||||||
private:
|
private:
|
||||||
Color trace_ray(const Ray &ray, const int depth);
|
Color trace_ray(const Ray &ray, const int depth);
|
||||||
|
|
||||||
|
// Pixel dimensions of the image.
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
|
// Ray tracing parameters.
|
||||||
|
int max_depth;
|
||||||
|
|
||||||
|
// Scene objects.
|
||||||
std::list<Shape *> shapes;
|
std::list<Shape *> shapes;
|
||||||
std::list<Light *> lights;
|
std::list<Light *> lights;
|
||||||
|
|
||||||
|
// Rendering output.
|
||||||
bool _is_rendered;
|
bool _is_rendered;
|
||||||
Color *pixels;
|
Color *pixels;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue