Creating a Raytracing Context

A raytracing context is a standalone world, composed of:

Settings can be customised at any time, either when creating a context or at runtime:

// Customise when creating
var context = new RaytracingContext()
{
    WorldPosition = new Vector3F(0),
    WorldSize = new Vector3F(100),
};

// Customise at runtime
context.WorldSize = new Vector3F(500);

The full list of fields and methods is available here: RaytracingContext.

AirAbsorption

Customise humidity, temperature and pressure settings, or provide your own custom formula.

context.AirAbsorption = new AirAbsorptionSettings()
{
    HumidityPercent = 0.4f,
    TemperatureCelsius = 26
};

Read more: Air Absorption.

Materials

Customise absorption, scattering and transmission values for existing materials, or create new materials.

var metal = context.GetMaterial(MaterialType.Metal);
metal.AbsorptionLF = 0.1f;

context.MaterialsDirty = true;

Read more: Materials.

CustomEaxFormulas

This class allows overriding the default formulas for calculating EAX reverb properties.

Read more: Custom EAX Formulas.