Tramway SDK
|
Experimental path tracing audio system. More...
Classes | |
struct | AudioBuffer |
struct | AudioRender |
struct | AudioSource |
struct | PathExplorationResult |
struct | PathFromAudioSource |
struct | PathRenderingInfo |
struct | PathTracingResult |
Enumerations | |
enum | AudioSourceFlags : uint16_t { SOURCE_PLAYING = 1 , SOURCE_REPEATING = 2 } |
enum | AudioSampleRate : uint16_t { SAMPLERATE_44100 = 1 , SAMPLERATE_22050 = 2 , SAMPLERATE_11025 = 4 } |
Functions | |
void | InitOutput () |
void | UpdateOutput () |
void | UninitOutput () |
void | LockRenderlist () |
void | UnlockRenderlist () |
void | FindPaths (PathExplorationResult &result, bool metropolis, vec3 position) |
void | FindPathsMetropolis (PathExplorationResult *exploration, PathTracingResult *result, vec3 position) |
void | InitExplorationPaths (PathExplorationResult *paths) |
void | ValidateResult (PathTracingResult &result, vec3 position) |
void | RenderResult (PathTracingResult &result, vec3 position) |
void | CheckReverb (PathExplorationResult *paths) |
void | MakeSomeSourcePaths (PathFromAudioSource &path, vec3 source_position) |
Variables | |
const size_t | PATHS_FOR_RENDERING = 10 |
const size_t | PATHS_FOR_SOURCE = 5 |
const size_t | PATHS_FOR_LISTENER = 5 |
const size_t | BUFFER_COUNT = 1000 |
const size_t | SOURCE_COUNT = 200 |
const size_t | SOURCE_DEPTH_LIMIT = 3 |
const size_t | LISTENER_DEPTH_LIMIT = 6 |
AudioBuffer | audiobuffers [BUFFER_COUNT] |
AudioSource | audiosources [SOURCE_COUNT] |
AudioRender | audiorenders [SOURCE_COUNT] |
vec3 | listener_position |
quat | listener_orientation |
int32_t | listener_reverb_delay [5] |
float | listener_reverb_distance [5] |
float | listener_reverb_force [5] |
float | listener_reverb_normalized [5] |
Experimental path tracing audio system.
It uses bi-directional path tracing together with Primary Sample Space Metropolis Light Transport algorithm to find paths between the listener and audio sources.
It then attentuates sounds based on surface reflection absorption and distance, does panning based on the angle between the listener and the last reflection and then convolves the resulting impulse response with the sound being played back by the audio source.
Sounds pretty bad (needs tweaking), very slow as well (no optimizations).
I haven't tried recently, but it probably doesn't even compile.
Make sure that it compiles and do some improvements
Investigate the possibilities of using hardware accelerated ray-tracing
I am very poor and can't afford a graphics card, NVIDIA pls sponsor me
enum tram::Audio::Spatial::AudioSampleRate : uint16_t |
enum tram::Audio::Spatial::AudioSourceFlags : uint16_t |
void tram::Audio::Spatial::CheckReverb | ( | PathExplorationResult * | paths | ) |
void tram::Audio::Spatial::FindPaths | ( | PathExplorationResult & | result, |
bool | metropolis, | ||
vec3 | position | ||
) |
void tram::Audio::Spatial::FindPathsMetropolis | ( | PathExplorationResult * | exploration, |
PathTracingResult * | result, | ||
vec3 | position | ||
) |
void tram::Audio::Spatial::InitExplorationPaths | ( | PathExplorationResult * | paths | ) |
void tram::Audio::Spatial::InitOutput | ( | ) |
void tram::Audio::Spatial::LockRenderlist | ( | ) |
void tram::Audio::Spatial::MakeSomeSourcePaths | ( | PathFromAudioSource & | path, |
vec3 | source_position | ||
) |
void tram::Audio::Spatial::RenderResult | ( | PathTracingResult & | result, |
vec3 | position | ||
) |
void tram::Audio::Spatial::UninitOutput | ( | ) |
void tram::Audio::Spatial::UnlockRenderlist | ( | ) |
void tram::Audio::Spatial::UpdateOutput | ( | ) |
void tram::Audio::Spatial::ValidateResult | ( | PathTracingResult & | result, |
vec3 | position | ||
) |
|
extern |
|
extern |
|
extern |
const size_t tram::Audio::Spatial::BUFFER_COUNT = 1000 |
const size_t tram::Audio::Spatial::LISTENER_DEPTH_LIMIT = 6 |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
const size_t tram::Audio::Spatial::PATHS_FOR_LISTENER = 5 |
const size_t tram::Audio::Spatial::PATHS_FOR_RENDERING = 10 |
const size_t tram::Audio::Spatial::PATHS_FOR_SOURCE = 5 |
const size_t tram::Audio::Spatial::SOURCE_COUNT = 200 |
const size_t tram::Audio::Spatial::SOURCE_DEPTH_LIMIT = 3 |