Untitled
Loading...
Searching...
No Matches
audio_probe_bake.comp File Reference

Go to the source code of this file.

Data Structures

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  AudioProbe
 Baked IR samples loaded in from binary into APVs from ProbeVolumes. More...
struct  AudioSample
struct  RayHit

Macros

#define SAMPLE_RATE   48000
#define SPEED_OF_SOUND   343.0f
#define MAX_SAMPLES   (SAMPLE_RATE * 1)
#define NUM_RAYS   100000

Functions

 layout (local_size_x=16, local_size_y=16) in
 layout (std430, binding=2) buffer MaterialData
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)
RayHit ray_intersects_triangle (vec3 origin, vec3 dir, vec3 a, vec3 b, vec3 c)
bool slab_test (BVHNode n, vec3 pos, vec3 inv_dir)
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)
void main ()

Variables

uint state = 0
RayHit hit
uniform uint uProbeSize
uniform uint uRayOffset
uniform uint uIterations
uniform uint uMaxSamplesPerProbe
uniform uint uBounces
uniform uint uBatchSize
uniform uint uProbeOffset
const int AUDIO_NUM_BANDS = 6

Data Structure Documentation

◆ Vertex

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

◆ Face

struct Face

Definition at line 65 of file audio_probe_bake.comp.

Data Fields
uvec3 indices
uint material_id
vec3 normal
uint mesh_id
uint bvh_index
uint tri_idx
uint pad0
uint pad1
Vertex v0
Vertex v1
Vertex v2

◆ AABB

struct AABB

Definition at line 110 of file audio_probe_bake.comp.

Data Fields
vec3 min
uint pad0
vec3 max
uint pad1
vec3 center
uint pad2
vec3 extents
uint pad3
vec4 min
vec4 max
float min_x
float max_x
float min_y
float max_y
float min_z
float max_z

◆ BVHNode

struct BVHNode

Nodes for the acceleration structures of BVHs.

See also
Scene MeshNode BVH: Globals.scene_data.bvh_nodes
Light BVH: Globals.scene_data.light_bvh.nodes
Mesh MeshFace BVH: Mesh.nodes
core/acceleration.c

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.

◆ AudioSample

struct AudioSample

Definition at line 168 of file audio_probe_bake.comp.

Data Fields
vec3 arrival_dir
float time_of_flight
vec3 pos
uint valid
float energy[6]
uint pad0
uint pad1
float abs_energy[6]
uint pad4
uint pad5

◆ RayHit

struct RayHit

Definition at line 271 of file audio_probe_bake.comp.

Data Fields
vec3 pos
float t
vec3 barycentrics
uint mn_idx
vec3 normal
uint tri_idx
float best_t
float blocked_t
bool hit
bool occluded
uint pad1
size_t mesh_node_idx
size_t tri
HitType hit
float b0
float b1
float b2

Macro Definition Documentation

◆ SAMPLE_RATE

#define SAMPLE_RATE   48000

Definition at line 7 of file audio_probe_bake.comp.

Referenced by generate_synthetic_IR_tail(), and process_probe_chunk().

◆ SPEED_OF_SOUND

#define SPEED_OF_SOUND   343.0f

Definition at line 8 of file audio_probe_bake.comp.

Referenced by main().

◆ MAX_SAMPLES

#define MAX_SAMPLES   (SAMPLE_RATE * 1)

◆ NUM_RAYS

#define NUM_RAYS   100000

Definition at line 10 of file audio_probe_bake.comp.

Function Documentation

◆ layout() [1/2]

◆ layout() [2/2]

layout ( std430 ,
binding = 2 )

Definition at line 43 of file audio_probe_bake.comp.

References layout().

◆ pcg_hash()

uint pcg_hash ( )

Definition at line 190 of file audio_probe_bake.comp.

References pcg_hash(), and state.

Referenced by pcg_hash(), and rand().

◆ wang_hash()

uint wang_hash ( uint seed)

Definition at line 197 of file audio_probe_bake.comp.

References wang_hash().

Referenced by main(), and wang_hash().

◆ rand()

◆ frisvad_basis()

void frisvad_basis ( in vec3 n,
out vec3 b1,
out vec3 b2 )

Definition at line 209 of file audio_probe_bake.comp.

References frisvad_basis(), and n.

Referenced by frisvad_basis(), frisvad_basis(), and get_bounce_direction().

◆ get_bounce_direction()

vec3 get_bounce_direction ( vec3 normal)

◆ generate_sphere_dir()

vec3 generate_sphere_dir ( int i,
int N )

◆ ray_intersects_triangle()

◆ slab_test()

bool slab_test ( BVHNode n,
vec3 pos,
vec3 inv_dir )

◆ traverse_mesh_bvh()

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 )

◆ traverse_scene_bvh()

◆ main()

Variable Documentation

◆ state

uint state = 0

Definition at line 188 of file audio_probe_bake.comp.

Referenced by main(), and pcg_hash().

◆ hit

◆ uProbeSize

uniform uint uProbeSize

Definition at line 451 of file audio_probe_bake.comp.

Referenced by main().

◆ uRayOffset

uniform uint uRayOffset

Definition at line 452 of file audio_probe_bake.comp.

Referenced by main().

◆ uIterations

uniform uint uIterations

Definition at line 453 of file audio_probe_bake.comp.

Referenced by main(), and trace_path().

◆ uMaxSamplesPerProbe

uniform uint uMaxSamplesPerProbe

Definition at line 454 of file audio_probe_bake.comp.

Referenced by main().

◆ uBounces

uniform uint uBounces

Definition at line 455 of file audio_probe_bake.comp.

Referenced by main().

◆ uBatchSize

uniform uint uBatchSize

Definition at line 456 of file audio_probe_bake.comp.

Referenced by main().

◆ uProbeOffset

uniform uint uProbeOffset

Definition at line 457 of file audio_probe_bake.comp.

Referenced by main().

◆ AUDIO_NUM_BANDS

const int AUDIO_NUM_BANDS = 6

Definition at line 462 of file audio_probe_bake.comp.