forked from hkust-psan1/psan1-rendering-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
scene.h
100 lines (70 loc) · 1.93 KB
/
scene.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef SCENE_
#define SCENE_
#include <Windows.h>
#include <stdio.h>
#include <conio.h>
#include <ctime>
#include <optixu/optixpp_namespace.h>
#include <optixu/optixu_math_namespace.h>
#include <optixu/optixu_matrix_namespace.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <ImageLoader.h>
#include <GLUTDisplay.h>
#include <ObjLoader.h>
#include <sutil.h>
#include <string>
#include <iostream>
#include <stdlib.h>
#include "common_structs.h"
#include <string.h>
#include "random.h"
#include "scene_object.h"
#include "collider.h"
#include "obj_file_processor.h"
#include "gui_control.h"
using namespace optix;
class Scene : public SampleScene {
public:
Scene( const std::string& obj_path, int camera_type );
// From SampleScene
void initScene( InitialCameraData& camera_data );
void trace( const RayGenCameraData& camera_data );
void doResize( unsigned int width, unsigned int depth );
Buffer getOutputBuffer();
void initObjects();
void resetObjects();
btDiscreteDynamicsWorld* world;
std::vector<SceneObject*> sceneObjects;
// std::vector<BowlingPin*> pins;
// Ball* ball;
std::string m_obj_path;
int m_dof_sample_num;
int m_camera_type;
void createContext( SampleScene::InitialCameraData& camera_data );
void createMaterials(Material material[] );
// Helper functions
void makeMaterialPrograms( Material material, const char *filename,
const char *ch_program_name, const char *ah_program_name );
int getEntryPoint() { return m_camera_type; }
void genRndSeeds(unsigned int width, unsigned int height);
enum {
DOF = 0,
AdaptivePinhole = 1,
Pinhole = 2
};
void createGeometry();
Buffer m_rnd_seeds;
unsigned int m_frame_number;
float distance_offset;
static unsigned int WIDTH;
static unsigned int HEIGHT;
cv::VideoWriter writer;
Group g;
int currSampleInFrame;
int samplesPerFrame;
std::vector<cv::Mat> motionBlurImages;
int motionBlurImageNum;
int motionBlurImageIndex;
};
#endif