Implémentation du raytracing pour Global Memory/Shared Memory/Constant Memory
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 04_RayTracing / moo / host / RayTracing.h
1 #ifndef RAY_TRACING_H
2 #define RAY_TRACING_H
3
4 #include "cudaTools.h"
5 #include "Animable_I.h"
6 #include "MathTools.h"
7 #include "AleaTools.h"
8
9 #include "Sphere.h"
10
11 class RayTracing : public Animable_I
12 {
13 public:
14 RayTracing(int w, int h);
15 ~RayTracing();
16
17 void runGPU(uchar4* ptrDevPixels) /*override*/;
18 void animationStep() /*override*/;
19
20 int getW() /*override*/;
21 int getH() /*override*/;
22
23 float getT() /*override*/;
24
25 std::string getTitle(void) /*override*/;
26
27 private:
28 /**
29 * Crée un tablean de 'n' sphères dont le rayon, la couleur et la position sont générés aléatoirement.
30 */
31 Sphere* createSpheres(int n);
32
33 Sphere* ptrDevSpheres; // Pointeur sur la mémoire du GPU.
34
35 AleaTools alea;
36
37 float t;
38
39 const int w;
40 const int h;
41
42 const dim3 dg;
43 const dim3 db;
44
45 const std::string title;
46 };
47
48 #endif