-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRaytracer.h
35 lines (28 loc) · 1.05 KB
/
Raytracer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
Raytracer.h
Static class. Traces a ray.
*/
#ifndef I_RAYTR
#define I_RAYTR
#include <glm/glm.hpp>
class Scene;
#include "Scene.h"
#include "Intersection.h"
#include "Primitive.h"
class Raytracer {
public:
Raytracer(Scene* scene);
~Raytracer();
glm::dvec3 pathTraceRay(const Ray& ray, int depth, double weight, int bounce);
private:
int maxDepth;
bool findClosestIntersection(const Ray& ray, int& closestIntersectionIndex, Intersection& closestIntersection);
glm::dvec3 directLighting(const Ray& ray, const Intersection& surfaceIntersection,
const Primitive& intersectedObject);
void sampleUniformHemisphere(Ray& ray, const Intersection& surfaceIntersection);
void sampleCosineWeightedHemisphere(Ray& ray, const Intersection& surfaceIntersection);
void sampleSpecularLobe(Ray& ray, const Intersection& surfaceIntersection, const glm::dvec3& reflection,
const double shininess);
Scene* scene;
};
#endif