-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
55 lines (43 loc) · 1.16 KB
/
main.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "OpenGLViewer.h"
#include "Img.h"
#include "MCRayTracer.h"
#include "Camera.h"
#include "Vector3.h"
#include "ImplicitCornellBox.h"
#include "OBJMesh.h"
#include "PhotonMap.h"
const unsigned int WIDTH = 600;
const unsigned int HEIGHT = 400;
#include <ctime>
#include <cmath>
#include <stdlib.h>
int main()
{
// Create the camera
Camera camera(WIDTH,HEIGHT,1.5,1);
camera.SetFov(65);
camera.LookAt(cbh::vec3(0,0,10), cbh::vec3(0,0,0), cbh::vec3(0,1,0));
ImplicitCornellBox scene;
scene.Init();
scene.setCamera(&camera);
//Screenbuffer
Img image(WIDTH,HEIGHT);
// OpenGL Viewer
OpenGLViewer viewer(WIDTH,HEIGHT);
//Create the render engine then set the screenbuffer and scene to render
MCRayTracer tracer;
tracer.setMaxReflection(3);
tracer.setMaxRefractions(3);
tracer.setMaxDiffuseBounces(3);
tracer.setFinalGatherRays(1);
tracer.setShadowRays(1);
tracer.setSamplesPerPixel(512);
tracer.setImage(&image);
tracer.setScene(&scene);
tracer.setViewer(&viewer);
tracer.generate_photon_map(100000,10);
tracer.generate_caustic_map(100000,5);
tracer.render();
std::cin.get();
return 0;
}