The reverb raytracing results can be accessed via the `RawReverb`, `ProcessedReverb` and `ListenerEAXReverb` fields on a [[raytraced-audio/v110/Classes/RaytracingContext|RaytracingContext]] instance. ```cs public void Update() { // Perform raytracing on background threads context.Update(...); // Ideally use a callback, so you can create/update your EAX reverb effects before emitter.OnRaytracingComplete is invoked context.OnReverbUpdated = () => { // Print reverb stats Console.WriteLine(context.RawReverb.ReturnedTotal); Console.WriteLine(context.ProcessedReverb.OutsidePercent); foreach (var eax in context.GroupedEAX) Console.WriteLine(eax.GainLF); } } ``` You can copy the values from a `EAXReverb` directly onto an EAX reverb preset in your engine. If you wish to calculate these values yourself, see [[raytraced-audio/v110/Formulas/Custom EAX Formulas|Custom EAX Formulas]]. ## Reverb Variables `RawReverb` contains the raw results of raytracing. More details are in [[raytraced-audio/v110/Classes/RawReverbResults|RawReverbResults]]. ```cs float DistanceTotal; float ReturnedTotal; float OutsideTotal; ``` `ProcessedReverb` contains the results of raytracing that have been processed into a more dev-friendly format. More details are in [[raytraced-audio/v110/Classes/ProcessedReverbResults|ProcessedReverbResults]]. `GroupedEAX` objects contain values that can be directly set on an EAX reverb effect. More details are in [[raytraced-audio/v110/Classes/EAXReverbResults|EAXReverbResults]]. > These EAX values are calculated using generic formulas, so you may want to calculate these yourself. Check out [[raytraced-audio/v110/Formulas/Custom EAX Formulas|Custom EAX Formulas]] for more details. Each emitter that casts reverb rays also has its `EAX` property. ## Reverb Pan When multiple emitters are grouped into a grouped EAX object, all of their returning reverb rays can be compared against another emitter's position to determine the reverb directionality / pan vector. To enable this, set `HasReverbPan` to true on your main listener emitter. Then in the `OnReverbUpdated` callback, in each grouped EAX you can access the pan vector for this EAX preset for a specific emitter: // TODO - check this code ```cs Emitter listener; void Initialise() { listener = new Emitter() { HasReverbPan = true, }; context.AddEmitter(listener); context.OnReverbUpdated = OnReverbUpdated; } void OnReverbUpdated() { foreach (var eax in context.GroupedEAX) { var pan = eax.Pan[listener]; // Set this pan vector on your OpenAL EAX preset } } ``` The pan vector is not normalised - its magnitude indicates how strong the reverb directionality is. For example if the pan vector is `(0, 0, 0)`, you'll hear reverb all around you, and if the pan vector is `(0, 0, 1)`, you'll hear reverb in that direction. It's rare that the direction of all reverb rays will average to a pan vector of `(0, 0, 0)`, so you can set a minimum threshold that's required for the reverb to be all around you: ```cs Emitter listener; void Initialise() { listener = new Emitter() { HasReverbPan = true, ReverbPanInnerThreshold = 0.5f, ReverbPanOuterThreshold = 0.8f, }; context.AddEmitter(listener); } ``` In the example above, pan will blend from fully directional at 0.8f magnitude, to all around you at 0.5f magnitude. This means you don't need to be fully enclosed in a room to hear the reverb all around you. If the pan vector has a magnitude of 0.5f or less, the resulting pan will be (0, 0, 0). The same applies to the outer threshold, which defaults to 1.0f and can be reduced if you'd like reverb to be directional more easily. For example if the pan vector has a magnitude of 0.8f or more, the resulting pan will have a magnitude of 1.