forked from DerRM/VulkanRaytracingProceduralGeometry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraytracingglsldefines.hxx
90 lines (74 loc) · 1.7 KB
/
raytracingglsldefines.hxx
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
#ifndef RAYTRACINGGLSLDEFINES_HXX
#define RAYTRACINGGLSLDEFINES_HXX
#include <stdint.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
struct SceneConstantBuffer {
glm::mat4 projectionToWorld;
glm::vec4 cameraPosition;
glm::vec4 lightPosition;
glm::vec4 lightAmbientColor;
glm::vec4 lightDiffuseColor;
float reflectance;
float elapsedTime;
};
struct PrimitiveConstantBuffer {
glm::vec4 albedo;
float reflectanceCoef;
float diffuseCoef;
float specularCoef;
float specularPower;
float stepScale;
glm::vec3 padding;
};
struct PrimitiveInstanceConstantBuffer
{
uint32_t instanceIndex;
uint32_t primitiveType; // Procedural primitive type
glm::vec2 padding;
};
struct PrimitiveInstancePerFrameBuffer {
glm::mat4 localSpaceToBottomLevelAS;
glm::mat4 bottomLevelASToLocalSpace;
};
typedef uint16_t Index;
struct Vertex {
glm::vec3 position;
//glm::vec3 normal;
};
namespace RayType {
enum Enum {
Radiance = 0,
Shadow,
Count
};
}
static const glm::vec4 kChromiumReflectance = glm::vec4(0.549f, 0.556f, 0.554f, 1.0f);
static const glm::vec4 kBackgroundColor = glm::vec4(0.8f, 0.9f, 1.0f, 1.0f);
static const float kInShadowRadiance = 0.35f;
namespace AnalyticPrimitive {
enum Enum {
AABB = 0,
Spheres,
Count
};
}
namespace VolumetricPrimitive {
enum Enum {
Metaballs = 0,
Count
};
}
namespace SignedDistancePrimitive {
enum Enum {
MiniSpheres = 0,
IntersectedRoundCube,
SquareTorus,
TwistedTorus,
Cog,
Cylinder,
FractalPyramid,
Count
};
}
#endif // RAYTRACINGGLSLDEFINES_HXX