|
| template<class SceneType , bool bPathHashCombine = true> |
| static void | Trace (const SceneType &sceneInterface, const typename SceneType::Vec3 &origin, const TraceParameters ¶meters, TraceResults< typename SceneType::Intersection > &outTraceResults) |
| |
| template<class SceneType , class SpecularPathCacheContainer > |
| static void | ProcessTraces (SceneType &sceneInterface, const typename SceneType::SourceData &sourceData, TraceResults< typename SceneType::Intersection > &traces, std::span< const typename SceneType::ReceiverData > receiverData, SpecularPathCacheContainer &caches) |
| |
| template<class SceneType , class SpecularPathCacheContainer > |
| static void | ProcessTraces (SceneType &sceneInterface, const typename SceneType::SourceData &sourceData, TraceResults< typename SceneType::Intersection > &sourceTraces, std::span< const typename SceneType::ReceiverData > receiverData, CTraceResultsRange< typename SceneType::Intersection > auto receiverTraces, SpecularPathCacheContainer &caches) |
| |
Specular Ray Tracing algorithm. Supporting backtracing - tracing from the listener. And bidirectional tracing - from the listener and sources.
Example backtracing from the listener:
// Step 1. Trace paths from the listener's postiion
MySceneType scenInterface;
Vec3 listenerPosition = ...;
TraceParameters parameters = ...;
TraceResults outTraceResults;
SpecularRayTracing::Trace(scenInterface, listenerPosition, parameters, outTraceResults)
// Step 2. Process traces
SourceData sourceData{ listenerPosition, listenerId };
std::span<ReceiverData> receiverData = ... // per sound source { position, Id }
std::span<SpecularPathCache*> specularPathCache = ... // per sound source SPC
SpecularRayTracing::ProcessTraces(scenInterface, sourceData, outTraceResults, receiversData, specularPathCache);
// Step 3. Make early reflection taps from SpecularPathCache
...
For bidirectional traces: 1) Do Step 1 from above for listener and for each source.
template<class SceneType , class SpecularPathCacheContainer >
| void JPL::SpecularRayTracing::ProcessTraces |
( |
SceneType & | sceneInterface, |
|
|
const typename SceneType::SourceData & | sourceData, |
|
|
TraceResults< typename SceneType::Intersection > & | sourceTraces, |
|
|
std::span< const typename SceneType::ReceiverData > | receiverData, |
|
|
CTraceResultsRange< typename SceneType::Intersection > auto | receiverTraces, |
|
|
SpecularPathCacheContainer & | caches ) |
|
inlinestatic |
Process bidirectional traces, connect source paths with receivers and receiver paths with the source.
Note: here source is assumed to be listener and thus the Image Sources are constructed from the receivers.
- Parameters
-
| sceneInterface | Scene-query adapter used to validate paths. |
| sourceData | Data for the source of the traces. |
| sourceTraces | Traces generated from the source position. |
| receiverData | Data for the receivers of the traces. |
| receiverTraces | Traces generated from the receiver positions. |
| caches | Per-receiver specular-path caches updated with valid paths. |
- Template Parameters
-
| SpecularPathCacheContainer | must have operator[] overloaded to access cache for a receiver index |
template<class SceneType , class SpecularPathCacheContainer >
| void JPL::SpecularRayTracing::ProcessTraces |
( |
SceneType & | sceneInterface, |
|
|
const typename SceneType::SourceData & | sourceData, |
|
|
TraceResults< typename SceneType::Intersection > & | traces, |
|
|
std::span< const typename SceneType::ReceiverData > | receiverData, |
|
|
SpecularPathCacheContainer & | caches ) |
|
inlinestatic |
Process traces from source direction, connect paths to receivers.
Note: here source is assumed to be listener and thus the Image Sources are constructed from the receivers.
- Parameters
-
| sceneInterface | Scene-query adapter used to validate paths. |
| sourceData | Data for the source of the traces. |
| traces | Traces generated from the source position. |
| receiverData | Data for the receivers of the traces. |
| caches | Per-receiver specular-path caches updated with valid paths. |
- Template Parameters
-
| SpecularPathCacheContainer | must have operator[] overloaded to access cache for a receiver index |