#include "path_tracer.h"
#include "utils.glsl"
#include "global_textures.h"
#include "vertex_buffer.h"
#include "read_visbuf.glsl"
#include "asvgf.glsl"
#include "brdf.glsl"
#include "water.glsl"
#include "light_lists.h"
Go to the source code of this file.
Classes | |
struct | Ray |
Functions | |
layout (set=RAY_GEN_DESCRIPTOR_SET_IDX, binding=0) uniform accelerationStructureNV topLevelAS | |
layout (location=RT_PAYLOAD_SHADOW) rayPayloadNV RayPayloadShadow ray_payload_shadow | |
vec3 | env_map (vec3 direction, bool remove_sun) |
ivec2 | get_image_position () |
ivec2 | get_image_size () |
bool | found_intersection (RayPayload rp) |
bool | is_sky (RayPayload rp) |
bool | is_dynamic_instance (RayPayload pay_load) |
uint | get_primitive (RayPayload pay_load) |
Triangle | get_hit_triangle (RayPayload rp) |
vec3 | get_hit_barycentric (RayPayload rp) |
float | get_rng (uint idx) |
bool | is_water (uint material) |
bool | is_slime (uint material) |
bool | is_lava (uint material) |
bool | is_glass (uint material) |
bool | is_transparent (uint material) |
bool | is_chrome (uint material) |
bool | is_screen (uint material) |
bool | is_camera (uint material) |
vec3 | correct_albedo (vec3 albedo) |
vec3 | correct_emissive (uint material_id, vec3 emissive) |
void | trace_ray (Ray ray, bool cull_back_faces, int instance_mask) |
Ray | get_shadow_ray (vec3 p1, vec3 p2, float tmin) |
float | trace_shadow_ray (Ray ray, int cull_mask) |
vec3 | trace_caustic_ray (Ray ray, int surface_medium) |
vec3 | rgbToNormal (vec3 rgb, out float len) |
float | AdjustRoughnessToksvig (float roughness, float normalMapLen, float mip_level) |
void | get_direct_illumination (vec3 position, vec3 normal, vec3 geo_normal, uint cluster_idx, uint material_id, int shadow_cull_mask, vec3 view_direction, float roughness, int surface_medium, bool enable_caustics, float surface_specular, float direct_specular_weight, bool enable_polygonal, bool enable_spherical, bool is_gradient, int bounce, out vec3 diffuse, out vec3 specular) |
void | get_sunlight (uint cluster_idx, uint material_id, vec3 position, vec3 normal, vec3 geo_normal, vec3 view_direction, float roughness, int surface_medium, bool enable_caustics, out vec3 diffuse, out vec3 specular, int shadow_cull_mask) |
vec3 | clamp_output (vec3 c) |
vec3 | sample_emissive_texture (uint material_id, MaterialInfo minfo, vec2 tex_coord, vec2 tex_coord_x, vec2 tex_coord_y, float mip_level) |
vec2 | lava_uv_warp (vec2 uv) |
vec3 | get_emissive_shell (uint material_id) |
bool | get_is_gradient (ivec2 ipos) |
void | get_material (Triangle triangle, vec2 tex_coord, vec2 tex_coord_x, vec2 tex_coord_y, float mip_level, vec3 geo_normal, out vec3 albedo, out vec3 normal, out float metallic, out float specular, out float roughness, out vec3 emissive) |
bool | get_camera_uv (vec2 tex_coord, out vec2 cameraUV) |
Variables | |
uint | rng_seed |
#define BOUNCE_RAY_CULL_MASK (AS_FLAG_OPAQUE | AS_FLAG_SKY | AS_FLAG_CUSTOM_SKY) |
Definition at line 58 of file path_tracer_rgen.h.
#define BOUNCE_SPECULAR 1 |
Definition at line 64 of file path_tracer_rgen.h.
#define DESATURATE_ENVIRONMENT_MAP 1 |
Definition at line 39 of file path_tracer_rgen.h.
#define GLOBAL_TEXTURES_DESC_SET_IDX 2 |
Definition at line 27 of file path_tracer_rgen.h.
#define MAX_OUTPUT_VALUE 1000 |
Definition at line 66 of file path_tracer_rgen.h.
#define NUM_RNG_PER_FRAME (RNG_NEE_STATIC_DYNAMIC(1) + 1) |
Definition at line 62 of file path_tracer_rgen.h.
#define PRIMARY_RAY_CULL_MASK (AS_FLAG_EVERYTHING & ~(AS_FLAG_VIEWER_MODELS | AS_FLAG_CUSTOM_SKY)) |
Definition at line 56 of file path_tracer_rgen.h.
#define RAY_GEN_DESCRIPTOR_SET_IDX 0 |
Definition at line 23 of file path_tracer_rgen.h.
#define REFLECTION_RAY_CULL_MASK (AS_FLAG_OPAQUE | AS_FLAG_PARTICLES | AS_FLAG_EXPLOSIONS | AS_FLAG_SKY) |
Definition at line 57 of file path_tracer_rgen.h.
#define RNG_BRDF_FRESNEL | ( | bounce | ) | (4 + 6 + 9 * bounce) |
Definition at line 52 of file path_tracer_rgen.h.
#define RNG_BRDF_X | ( | bounce | ) | (4 + 4 + 9 * bounce) |
Definition at line 50 of file path_tracer_rgen.h.
#define RNG_BRDF_Y | ( | bounce | ) | (4 + 5 + 9 * bounce) |
Definition at line 51 of file path_tracer_rgen.h.
#define RNG_NEE_LIGHT_SELECTION | ( | bounce | ) | (4 + 0 + 9 * bounce) |
Definition at line 46 of file path_tracer_rgen.h.
#define RNG_NEE_LIGHT_TYPE | ( | bounce | ) | (4 + 3 + 9 * bounce) |
Definition at line 49 of file path_tracer_rgen.h.
#define RNG_NEE_TRI_X | ( | bounce | ) | (4 + 1 + 9 * bounce) |
Definition at line 47 of file path_tracer_rgen.h.
#define RNG_NEE_TRI_Y | ( | bounce | ) | (4 + 2 + 9 * bounce) |
Definition at line 48 of file path_tracer_rgen.h.
#define RNG_PRIMARY_APERTURE_X 2 |
Definition at line 43 of file path_tracer_rgen.h.
#define RNG_PRIMARY_APERTURE_Y 3 |
Definition at line 44 of file path_tracer_rgen.h.
#define RNG_PRIMARY_OFF_X 0 |
Definition at line 41 of file path_tracer_rgen.h.
#define RNG_PRIMARY_OFF_Y 1 |
Definition at line 42 of file path_tracer_rgen.h.
#define RNG_SUNLIGHT_X | ( | bounce | ) | (4 + 7 + 9 * bounce) |
Definition at line 53 of file path_tracer_rgen.h.
#define RNG_SUNLIGHT_Y | ( | bounce | ) | (4 + 8 + 9 * bounce) |
Definition at line 54 of file path_tracer_rgen.h.
#define RT_PAYLOAD_BRDF 1 |
Definition at line 69 of file path_tracer_rgen.h.
#define RT_PAYLOAD_SHADOW 0 |
Definition at line 68 of file path_tracer_rgen.h.
#define SHADOW_RAY_CULL_MASK (AS_FLAG_OPAQUE) |
Definition at line 59 of file path_tracer_rgen.h.
#define VERTEX_BUFFER_DESC_SET_IDX 3 |
Definition at line 30 of file path_tracer_rgen.h.
#define VERTEX_READONLY 1 |
Definition at line 31 of file path_tracer_rgen.h.
float AdjustRoughnessToksvig | ( | float | roughness, |
float | normalMapLen, | ||
float | mip_level | ||
) |
Definition at line 365 of file path_tracer_rgen.h.
Referenced by get_material().
vec3 clamp_output | ( | vec3 | c | ) |
Definition at line 624 of file path_tracer_rgen.h.
vec3 correct_albedo | ( | vec3 | albedo | ) |
Definition at line 237 of file path_tracer_rgen.h.
Referenced by get_material(), and trace_caustic_ray().
vec3 correct_emissive | ( | uint | material_id, |
vec3 | emissive | ||
) |
Definition at line 243 of file path_tracer_rgen.h.
Referenced by sample_emissive_texture().
vec3 env_map | ( | vec3 | direction, |
bool | remove_sun | ||
) |
bool found_intersection | ( | RayPayload | rp | ) |
Definition at line 134 of file path_tracer_rgen.h.
Referenced by trace_caustic_ray().
bool get_camera_uv | ( | vec2 | tex_coord, |
out vec2 | cameraUV | ||
) |
Definition at line 805 of file path_tracer_rgen.h.
void get_direct_illumination | ( | vec3 | position, |
vec3 | normal, | ||
vec3 | geo_normal, | ||
uint | cluster_idx, | ||
uint | material_id, | ||
int | shadow_cull_mask, | ||
vec3 | view_direction, | ||
float | roughness, | ||
int | surface_medium, | ||
bool | enable_caustics, | ||
float | surface_specular, | ||
float | direct_specular_weight, | ||
bool | enable_polygonal, | ||
bool | enable_spherical, | ||
bool | is_gradient, | ||
int | bounce, | ||
out vec3 | diffuse, | ||
out vec3 | specular | ||
) |
Definition at line 375 of file path_tracer_rgen.h.
vec3 get_emissive_shell | ( | uint | material_id | ) |
Definition at line 669 of file path_tracer_rgen.h.
Referenced by get_material().
vec3 get_hit_barycentric | ( | RayPayload | rp | ) |
Triangle get_hit_triangle | ( | RayPayload | rp | ) |
ivec2 get_image_position | ( | ) |
Definition at line 110 of file path_tracer_rgen.h.
ivec2 get_image_size | ( | ) |
Definition at line 128 of file path_tracer_rgen.h.
bool get_is_gradient | ( | ivec2 | ipos | ) |
Definition at line 688 of file path_tracer_rgen.h.
void get_material | ( | Triangle | triangle, |
vec2 | tex_coord, | ||
vec2 | tex_coord_x, | ||
vec2 | tex_coord_y, | ||
float | mip_level, | ||
vec3 | geo_normal, | ||
out vec3 | albedo, | ||
out vec3 | normal, | ||
out float | metallic, | ||
out float | specular, | ||
out float | roughness, | ||
out vec3 | emissive | ||
) |
Definition at line 706 of file path_tracer_rgen.h.
uint get_primitive | ( | RayPayload | pay_load | ) |
Definition at line 152 of file path_tracer_rgen.h.
Referenced by get_hit_triangle().
float get_rng | ( | uint | idx | ) |
Definition at line 177 of file path_tracer_rgen.h.
Referenced by get_direct_illumination(), and get_sunlight().
Ray get_shadow_ray | ( | vec3 | p1, |
vec3 | p2, | ||
float | tmin | ||
) |
Definition at line 264 of file path_tracer_rgen.h.
Referenced by get_direct_illumination(), and get_sunlight().
void get_sunlight | ( | uint | cluster_idx, |
uint | material_id, | ||
vec3 | position, | ||
vec3 | normal, | ||
vec3 | geo_normal, | ||
vec3 | view_direction, | ||
float | roughness, | ||
int | surface_medium, | ||
bool | enable_caustics, | ||
out vec3 | diffuse, | ||
out vec3 | specular, | ||
int | shadow_cull_mask | ||
) |
Definition at line 548 of file path_tracer_rgen.h.
bool is_camera | ( | uint | material | ) |
Definition at line 231 of file path_tracer_rgen.h.
bool is_chrome | ( | uint | material | ) |
bool is_dynamic_instance | ( | RayPayload | pay_load | ) |
Definition at line 146 of file path_tracer_rgen.h.
Referenced by get_hit_triangle().
bool is_glass | ( | uint | material | ) |
Definition at line 206 of file path_tracer_rgen.h.
Referenced by get_material(), and trace_caustic_ray().
bool is_lava | ( | uint | material | ) |
Definition at line 200 of file path_tracer_rgen.h.
Referenced by collect_sky_and_lava_ligth_polys().
bool is_screen | ( | uint | material | ) |
Definition at line 225 of file path_tracer_rgen.h.
Referenced by get_material().
bool is_sky | ( | RayPayload | rp | ) |
Definition at line 140 of file path_tracer_rgen.h.
Referenced by collect_sky_and_lava_ligth_polys(), and create_poly().
bool is_slime | ( | uint | material | ) |
Definition at line 194 of file path_tracer_rgen.h.
Referenced by trace_caustic_ray().
bool is_transparent | ( | uint | material | ) |
Definition at line 212 of file path_tracer_rgen.h.
bool is_water | ( | uint | material | ) |
Definition at line 188 of file path_tracer_rgen.h.
Referenced by trace_caustic_ray().
vec2 lava_uv_warp | ( | vec2 | uv | ) |
layout | ( | location | = RT_PAYLOAD_SHADOW | ) |
layout | ( | set | = RAY_GEN_DESCRIPTOR_SET_IDX , |
binding | = 0 |
||
) |
vec3 rgbToNormal | ( | vec3 | rgb, |
out float | len | ||
) |
vec3 sample_emissive_texture | ( | uint | material_id, |
MaterialInfo | minfo, | ||
vec2 | tex_coord, | ||
vec2 | tex_coord_x, | ||
vec2 | tex_coord_y, | ||
float | mip_level | ||
) |
Definition at line 294 of file path_tracer_rgen.h.
Referenced by get_direct_illumination(), and get_sunlight().
Definition at line 249 of file path_tracer_rgen.h.
Definition at line 280 of file path_tracer_rgen.h.
Referenced by get_direct_illumination(), and get_sunlight().
uint rng_seed |
Definition at line 73 of file path_tracer_rgen.h.
Referenced by get_rng().