-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathOptixTest.hpp
40 lines (34 loc) · 928 Bytes
/
OptixTest.hpp
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
#include <curand_kernel.h>
#include "geommath.hpp"
#include "RayTracingCamera.hpp"
#include "Image.hpp"
#include "Color.hpp"
#include "TestMaterial.hpp"
struct Params{
My::Image* image;
My::RayTracingCamera<float>* cam;
curandStateMRG32k3a* rand_state;
OptixTraversableHandle handle;
int32_t max_depth;
int32_t num_of_samples;
};
struct RayGenData{
};
struct MissData {
My::RGBf bg_color;
};
struct HitGroupData {
Material material_type;
My::RGBf base_color;
float fuzz;
float ir;
};
template <typename T>
struct SbtRecord
{
__align__( OPTIX_SBT_RECORD_ALIGNMENT ) char header[OPTIX_SBT_RECORD_HEADER_SIZE];
T data;
};
using RayGenSbtRecord = SbtRecord<RayGenData>;
using MissSbtRecord = SbtRecord<MissData>;
using HitGroupSbtRecord = SbtRecord<HitGroupData>;