|
Untitled
|
Go to the source code of this file.
Data Structures | |
| struct | Light |
| The CPU side structure for Lights. More... | |
| struct | Material |
| The Materials parsed in from scene files that determine rendering pipeline setup, uploads, and ordering. More... | |
| struct | Vertex |
| struct | Face |
| struct | MeshNode |
| MeshNodes that describe the position of Meshes, GLTF nodes for GLTFAnimations, or hold references to other MeshNodes. More... | |
| struct | AABB |
| struct | BVHNode |
| Nodes for the acceleration structures of BVHs. More... | |
| struct | SHData |
| struct | RayHit |
Macros | |
| #define | MINIMUM_LIGHT_VISIBILITY_DIST 0.1 |
Functions | |
| layout (local_size_x=8, local_size_y=8, local_size_z=8) in | |
| layout (std430, binding=0) buffer LightData | |
| uint | pcg_hash () |
| uint | wang_hash (uint seed) |
| float | rand () |
| void | frisvad_basis (in vec3 n, out vec3 b1, out vec3 b2) |
| vec3 | get_bounce_direction (vec3 normal) |
| vec3 | generate_sphere_dir (int i, int N) |
| bool | ray_intersects_triangle (vec3 origin, vec3 dir, vec3 a, vec3 b, vec3 c, out RayHit out_hit) |
| bool | slab_test (BVHNode n, vec3 pos, vec3 inv_dir) |
| vec2 | get_uvs (vec3 B, uint tri_idx) |
| vec2 | get_hit_uvs (in Face tri, in RayHit hit) |
| vec4 | get_hit_albedo (in Material mat, vec2 hit_uv) |
| vec3 | get_hit_emissive (in Material mat, vec2 hit_uv) |
| void | traverse_mesh_bvh (uint node_offset, uint mn_id, vec3 pp, vec3 pm, vec3 original_dir, vec3 dir, vec3 md, uint mesh, uint tri) |
| void | traverse_scene_bvh (vec3 pp, vec3 dir, vec3 inv_dir, uint light_type, uint mesh, uint tri) |
| vec3 | compute_3d_barycentric (vec3 a, vec3 b, vec3 c, vec3 p) |
| float | CalculateAttenuation (float distance, float radius, float intensity) |
| vec3 | solve_light_source (Light l, vec3 pos, vec3 normal, uint mesh, uint tri) |
| vec3 | random_pos_on_triangle (vec3 a, vec3 b, vec3 c) |
| vec3 | process_area_light (in Light light, vec3 pos, vec3 normal, vec3 brdf, float p_select, bool skip_normal) |
| vec3 | process_light (vec3 pos, vec3 normal, uint mesh, uint tri, vec3 brdf, Light light, float p_select) |
| vec3 | closest_point_on_aabb (vec3 pos, vec3 min, vec3 max) |
| bool | pos_inside_aabb (vec3 pos, vec3 min, vec3 max) |
| vec3 | traverse_light_bvh (vec3 pos, vec3 normal, uint mesh, uint tri, vec3 brdf) |
| vec3 | traverse_light_bvh_direct_emissives (vec3 pos, vec3 normal, vec3 brdf) |
| vec3 | resolve_transparents (vec3 throughput, vec3 pos, vec3 dir, vec3 inv_dir) |
| vec3 | trace_path (vec3 pos) |
| void | solve_SH (vec3 color, vec3 dir, int index, vec3 pos) |
| void | main () |
Variables | |
| uniform samplerCube | uSkybox |
| uniform ivec2 | uTileOffset |
| uniform int | uLightCount |
| uniform vec3 | uWorldMin |
| uniform ivec3 | uProbeSize |
| uniform int | uCurrentIteration |
| uniform int | uIterations |
| uniform float | uSpacing |
| uint | state = 0 |
| RayHit | hit |
| vec3 | first_dir |
| struct Vertex |
Definition at line 49 of file audio_probe_bake.comp.
| Data Fields | ||
|---|---|---|
| vec3 | pos | |
| uint | pad0 | |
| vec3 | normal | |
| uint | pad1 | |
| vec2 | uv | |
| uint | pad2 | |
| uint | pad3 | |
| struct Face |
| struct AABB |
| struct BVHNode |
Nodes for the acceleration structures of BVHs.
Definition at line 125 of file audio_probe_bake.comp.
| Data Fields | ||
|---|---|---|
| int | left |
Left child. -1 if empty. |
| int | right |
Right child. -1 if empty. |
| int | parent |
Parent. -1 if empty. |
| int | index | The index of the node inside of the array. |
| int | first_index | |
| int | count | |
| int | next |
The pointer to the next node (either right child or parent's right child) for recursion-less traversal. See: assign_next_nodes(). |
| uint | pad0 | |
| vec3 | min | |
| uint | pad1 | |
| vec3 | max | |
| uint | pad2 | |
| vec3 | center | |
| uint | pad3 | |
| vec3 | extents | |
| uint | pad4 | |
| AABB | aabb | The bounding box of all of this node's children. |
| size_t | first_index | The first index into the bvh_indices array. |
| size_t | count | How many children are inside this node. |
| float | flux |
The total light flux of this node. Used for Light BVH importance sampling. |
| float | emissive_flux |
The only-emissive flux. Used for Light BVH importance sampling. |
| struct SHData |
Definition at line 189 of file probe_bake.comp.
| Data Fields | ||
|---|---|---|
| vec3 | pos | |
| uint | pad0 | |
| vec4 | coefficients[9] | |
| struct RayHit |
| #define MINIMUM_LIGHT_VISIBILITY_DIST 0.1 |
Definition at line 218 of file probe_bake.comp.
| layout | ( | std430 | , |
| binding | = 0 ) |
Definition at line 37 of file probe_bake.comp.
References layout().
| uint pcg_hash | ( | ) |
Definition at line 240 of file probe_bake.comp.
References pcg_hash(), and state.
| uint wang_hash | ( | uint | seed | ) |
Definition at line 247 of file probe_bake.comp.
References wang_hash().
| float rand | ( | ) |
Definition at line 256 of file probe_bake.comp.
References pcg_hash(), and rand().
Definition at line 260 of file probe_bake.comp.
References frisvad_basis(), and n.
Definition at line 279 of file probe_bake.comp.
References frisvad_basis(), get_bounce_direction(), rand(), TBN, and vec3::z.
| vec3 generate_sphere_dir | ( | int | i, |
| int | N ) |
Definition at line 308 of file probe_bake.comp.
References generate_sphere_dir().
Definition at line 324 of file probe_bake.comp.
References RayHit::hit, and ray_intersects_triangle().
Definition at line 370 of file probe_bake.comp.
References hit, n, slab_test(), RayHit::t, vec3::x, vec3::y, and vec3::z.
Definition at line 394 of file probe_bake.comp.
References RayHit::barycentrics, get_hit_uvs(), hit, vec3::x, vec3::y, and vec3::z.
Definition at line 402 of file probe_bake.comp.
References get_hit_albedo().
Definition at line 408 of file probe_bake.comp.
References get_hit_emissive().
| void traverse_mesh_bvh | ( | uint | node_offset, |
| uint | mn_id, | ||
| vec3 | pp, | ||
| vec3 | pm, | ||
| vec3 | original_dir, | ||
| vec3 | dir, | ||
| vec3 | md, | ||
| uint | mesh, | ||
| uint | tri ) |
Definition at line 416 of file probe_bake.comp.
References RayHit::best_t, RayHit::blocked_t, get_hit_albedo(), get_hit_uvs(), hit, RayHit::hit, Face::material_id, RayHit::mn_idx, n, Face::normal, RayHit::normal, RayHit::occluded, Vertex::pos, ray_intersects_triangle(), slab_test(), RayHit::t, traverse_mesh_bvh(), RayHit::tri_idx, Face::v0, Face::v1, and Face::v2.
Definition at line 504 of file probe_bake.comp.
References MeshNode::inverse_global_matrix, MeshNode::is_static, MeshNode::mesh_id, MeshNode::mesh_node_id, n, MeshNode::node_offset, slab_test(), traverse_mesh_bvh(), and traverse_scene_bvh().
Definition at line 544 of file probe_bake.comp.
References compute_3d_barycentric().
| float CalculateAttenuation | ( | float | distance, |
| float | radius, | ||
| float | intensity ) |
Definition at line 561 of file probe_bake.comp.
References CalculateAttenuation(), clamp(), and window.
Definition at line 572 of file probe_bake.comp.
References RayHit::best_t, RayHit::blocked_t, CalculateAttenuation(), clamp(), Light::color, Light::cos_diff, Light::dir, get_hit_albedo(), get_hit_uvs(), hit, RayHit::hit, Light::intensity, MeshNode::inverse_global_matrix, Light::light_type, Face::material_id, RayHit::mn_idx, Face::normal, RayHit::normal, RayHit::occluded, Light::outer_cos, Light::pos, RayHit::pos, Light::radius, solve_light_source(), RayHit::t, traverse_scene_bvh(), and RayHit::tri_idx.
Definition at line 688 of file probe_bake.comp.
References rand(), and random_pos_on_triangle().
| vec3 process_area_light | ( | in Light | light, |
| vec3 | pos, | ||
| vec3 | normal, | ||
| vec3 | brdf, | ||
| float | p_select, | ||
| bool | skip_normal ) |
Definition at line 698 of file probe_bake.comp.
References A, B, RayHit::best_t, RayHit::blocked_t, C, color, compute_3d_barycentric(), get_hit_albedo(), get_hit_emissive(), get_hit_uvs(), get_uvs(), MeshNode::global_matrix, hit, RayHit::hit, MeshNode::inverse_global_matrix, Face::material_id, RayHit::mn_idx, Face::normal, RayHit::normal, RayHit::occluded, RayHit::pos, Vertex::pos, process_area_light(), random_pos_on_triangle(), RayHit::t, traverse_scene_bvh(), RayHit::tri_idx, MeshNode::tri_offset, Face::v0, Face::v1, and Face::v2.
| vec3 process_light | ( | vec3 | pos, |
| vec3 | normal, | ||
| uint | mesh, | ||
| uint | tri, | ||
| vec3 | brdf, | ||
| Light | light, | ||
| float | p_select ) |
Definition at line 793 of file probe_bake.comp.
References Light::light_type, process_area_light(), process_light(), and solve_light_source().
Definition at line 824 of file probe_bake.comp.
References clamp(), and closest_point_on_aabb().
Definition at line 829 of file probe_bake.comp.
References pos_inside_aabb(), vec3::x, vec3::y, and vec3::z.
Definition at line 837 of file probe_bake.comp.
References closest_point_on_aabb(), color, Light::color, BVHNode::flux, Light::intensity, BVHNode::max, BVHNode::min, n, process_light(), rand(), solve_light_source(), traverse_light_bvh(), and uLightCount.
Definition at line 948 of file probe_bake.comp.
References closest_point_on_aabb(), color, BVHNode::emissive_flux, BVHNode::max, BVHNode::min, n, process_area_light(), rand(), and traverse_light_bvh_direct_emissives().
Definition at line 1024 of file probe_bake.comp.
References RayHit::best_t, RayHit::blocked_t, get_hit_albedo(), get_hit_uvs(), hit, RayHit::hit, MeshNode::inverse_global_matrix, Face::material_id, RayHit::mn_idx, Face::normal, RayHit::normal, RayHit::occluded, RayHit::pos, rand(), resolve_transparents(), RayHit::t, traverse_scene_bvh(), and RayHit::tri_idx.
Definition at line 1077 of file probe_bake.comp.
References RayHit::blocked_t, first_dir, generate_sphere_dir(), get_bounce_direction(), get_hit_albedo(), get_hit_emissive(), get_hit_uvs(), MeshNode::global_matrix, hit, RayHit::hit, MeshNode::inverse_global_matrix, Face::material_id, RayHit::mn_idx, Face::normal, RayHit::normal, RayHit::occluded, RayHit::pos, resolve_transparents(), RayHit::t, trace_path(), traverse_light_bvh(), traverse_light_bvh_direct_emissives(), RayHit::tri_idx, uCurrentIteration, uIterations, uSkybox, vec3::x, vec3::y, and vec3::z.
Definition at line 1229 of file probe_bake.comp.
References color, solve_SH(), vec3::x, vec3::y, and vec3::z.
Referenced by main(), and solve_SH().
| void main | ( | ) |
Definition at line 1257 of file probe_bake.comp.
References first_dir, main(), solve_SH(), state, trace_path(), uCurrentIteration, uProbeSize, wang_hash(), ivec3::x, ivec3::y, and ivec3::z.
| uniform samplerCube uSkybox |
Definition at line 205 of file probe_bake.comp.
| uniform ivec2 uTileOffset |
Definition at line 207 of file probe_bake.comp.
| uniform int uLightCount |
Definition at line 208 of file probe_bake.comp.
| uniform vec3 uWorldMin |
Definition at line 209 of file probe_bake.comp.
| uniform ivec3 uProbeSize |
Definition at line 211 of file probe_bake.comp.
| uniform int uCurrentIteration |
Definition at line 212 of file probe_bake.comp.
Referenced by main(), and trace_path().
| uniform int uIterations |
Definition at line 213 of file probe_bake.comp.
| uniform float uSpacing |
Definition at line 215 of file probe_bake.comp.
| uint state = 0 |
Definition at line 238 of file probe_bake.comp.
| RayHit hit |
Definition at line 322 of file probe_bake.comp.
| vec3 first_dir |
Definition at line 1075 of file probe_bake.comp.
Referenced by main(), and trace_path().