-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScene.h
More file actions
39 lines (33 loc) · 840 Bytes
/
Scene.h
File metadata and controls
39 lines (33 loc) · 840 Bytes
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
#pragma once
#include <CL/opencl.h>
//__declspec(align(16))
struct Camera {
cl_double theta;
cl_double winWidth;
cl_double winHeight;
cl_double3 __declspec(align(16)) pos; // ÆÁÄ»ÕýÖмäµÄλÖÃ
cl_double3 up;
cl_double3 lookAt;
};
struct Material {
cl_double refraction;
cl_double reflection;
/*
* 0: light
* 1: diffuse
* 2: metal
* 3: dieletric
* 4: fuzz metal
*/
cl_int type;
cl_double3 __declspec(align(16)) color;
};
struct Sphere {
cl_double radius;
cl_double3 __declspec(align(32)) pos;
Material mat;
};
cl_double3& operator /= (cl_double3& o1, const double o2);
cl_double3 operator / (const cl_double3 o1, const double o2);
void initScene1(Camera& cam, Sphere sphere[], int& sphereSize, int winWidth, int winHeight);
void initScene2(Camera& cam, Sphere sphere[], int& sphereSize, int winWidth, int winHeight);