include/raytracer.h
branchpyrit
changeset 48 a4913301c626
parent 47 320d5d466864
child 50 14a727b70d07
equal deleted inserted replaced
47:320d5d466864 48:a4913301c626
    55 	vector<Light*> lights;
    55 	vector<Light*> lights;
    56 	Colour bg_colour;
    56 	Colour bg_colour;
    57 	int ao_samples;
    57 	int ao_samples;
    58 	Float ao_distance, ao_angle;
    58 	Float ao_distance, ao_angle;
    59 	int num_threads;
    59 	int num_threads;
    60 	int subsample;
       
    61 	int oversample; // 0 = no, 1 = 5x, 2 = 9x, 3 = 16x
       
    62 	int max_depth;
    60 	int max_depth;
    63 
    61 
    64 	Vector3 SphereDistribute(int i, int n, Float extent, Vector3 &normal);
    62 	Vector3 SphereDistribute(int i, int n, Float extent, Vector3 &normal);
    65 public:
    63 public:
    66 	Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0.0, 0.0, 0.0),
    64 	Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0.0, 0.0, 0.0),
    67 		ao_samples(0), num_threads(2), subsample(8), oversample(0), max_depth(3) {};
    65 		ao_samples(0), num_threads(2), max_depth(3) {};
    68 	void render();
    66 	void render();
    69 	Colour raytrace(Ray &ray, int depth, Shape *origin_shape);
    67 	Colour raytrace(Ray &ray, int depth, Shape *origin_shape);
    70 	void addshape(Shape *shape) { top->addShape(shape); };
    68 	void addshape(Shape *shape) { top->addShape(shape); };
    71 	void addlight(Light *light);
    69 	void addlight(Light *light);
    72 	void setSampler(Sampler *sampl) { sampler = sampl; };
    70 	void setSampler(Sampler *sampl) { sampler = sampl; };
    73 	void setCamera(Camera *cam) { camera = cam; };
    71 	void setCamera(Camera *cam) { camera = cam; };
    74 	void setTop(Container *atop) { top = atop; };
    72 	void setTop(Container *atop) { top = atop; };
    75 	Container *getTop() { return top; };
    73 	Container *getTop() { return top; };
    76 	void setSubsample(int sub) { subsample = sub; };
    74 
    77 	int getSubsample() { return subsample; };
       
    78 	void setOversample(int osa) { oversample = osa; };
       
    79 	int getOversample() { return oversample; };
       
    80 	void setMaxDepth(int newdepth) { max_depth = newdepth; };
    75 	void setMaxDepth(int newdepth) { max_depth = newdepth; };
    81 
    76 
    82 	void ambientocclusion(int samples, Float distance, Float angle);
    77 	void ambientocclusion(int samples, Float distance, Float angle);
    83 	void setThreads(int num) { num_threads = num; };
    78 	void setThreads(int num) { num_threads = num; };
    84 };
    79 };