2021-07-10 20:06:55 +02:00
|
|
|
#extension GL_EXT_ray_tracing: require
|
2021-10-29 20:24:20 +02:00
|
|
|
|
|
|
|
#define PAYLOAD_LOCATION_OPAQUE 0
|
|
|
|
#define PAYLOAD_LOCATION_SHADOW 1
|
2021-10-29 21:04:45 +02:00
|
|
|
#define PAYLOAD_LOCATION_ADDITIVE 2
|
2021-10-29 20:24:20 +02:00
|
|
|
|
|
|
|
struct RayPayloadOpaque {
|
2021-10-29 21:04:45 +02:00
|
|
|
float t_offset, pixel_cone_spread_angle;
|
|
|
|
vec4 hit_pos_t;
|
2023-01-22 00:45:29 +01:00
|
|
|
vec4 prev_pos_t;
|
2021-10-29 21:04:45 +02:00
|
|
|
vec3 normal;
|
|
|
|
vec3 geometry_normal;
|
|
|
|
vec3 base_color;
|
2021-10-31 20:15:15 +01:00
|
|
|
float transmissiveness;
|
2021-10-29 21:04:45 +02:00
|
|
|
vec3 emissive;
|
|
|
|
float roughness;
|
2021-11-14 22:53:50 +01:00
|
|
|
float metalness;
|
2021-10-29 21:04:45 +02:00
|
|
|
int kusok_index;
|
2021-11-07 21:46:27 +01:00
|
|
|
uint material_index;
|
2021-11-19 20:31:45 +01:00
|
|
|
vec4 debug;
|
2021-08-26 19:41:35 +02:00
|
|
|
};
|
2021-10-29 20:24:20 +02:00
|
|
|
|
2021-11-25 20:53:44 +01:00
|
|
|
|
|
|
|
#define SHADOW_MISS 0
|
|
|
|
#define SHADOW_HIT 1
|
|
|
|
#define SHADOW_SKY 2
|
|
|
|
|
2021-10-29 20:24:20 +02:00
|
|
|
struct RayPayloadShadow {
|
2021-11-25 20:53:44 +01:00
|
|
|
uint hit_type;
|
2021-10-29 20:24:20 +02:00
|
|
|
};
|
|
|
|
|
2021-10-31 20:37:09 +01:00
|
|
|
|
|
|
|
const float additive_soft_overshoot = 16.;
|
2021-10-29 21:04:45 +02:00
|
|
|
struct RayPayloadAdditive {
|
|
|
|
vec3 color;
|
2021-10-31 20:37:09 +01:00
|
|
|
float ray_distance;
|
2021-10-29 21:04:45 +02:00
|
|
|
};
|