Custom EAX Formulas

EAX reverb variables are currently calculated using generic formulas that provide a decent starting point for most games. But you may want to adjust these variables to suit the style/environments in your game.

WARNING - the functions within CustomEAXFormulas will run on background threads. Do not attempt to access data from the main thread here.

To provide custom formulas, create a class that overrides CustomEAXFormulas.

public class MyEaxFormulas : CustomEAXFormulas
{
    // This function will run on a background thread
    public override float CalculateDiffusion()
    {
        return 0.5f;
    }
}

Then set this on the RaytracingContext:

var settings = new RaytracingContextSettings()
{
    customEaxFormulas = new MyEaxFormulas()
};

var context = new RaytracingContext(settings);

You can also set it at runtime:

// Clear the custom formulas
context.UpdateCustomEAXFormulas(null);

// Use new custom formulas
context.UpdateCustomEAXFormulas(new MyNewEaxFormulas());

Reference

View the CustomEAXFormulas.cs file in the SDK > References folder to see how each reverb property is currently calculated.