This is the documentation for Enlighten.
Probe LOD
Overview
Enlighten supports a level of detail solution for probes. The probe LOD feature allows you to solve a subset of probes within a probe set. Using the probe LOD feature can reduce solve time, particularly for probe sets with a dense placement of probes.
The probe LOD feature has the following limitations:
- The probe LOD feature is only available when using the Entire Probe Set Solver.
- The probe LOD feature is only available when using automatic probe placement.
Probes generated with automatic probe placement are grouped into LODs based on their depth within the octree.
Solve time
Scenes with a high density of probes will see a greater benefit when using probe LOD.
Base LOD
The High Level Runtime API provides a mechanism to limit the number of probes solved for each probe set generated from an octree probe volume. The base LOD parameter specifies the level of detail at which the probe set will be solved. All probes at this level and lower levels of detail will be solved. The default base LOD setting is zero, LOD0, which solves the probe set at the highest detail possible, and is equivalent to not using the probe LOD feature. Typically, you should select a base LOD level based on the distance of the probe set to the viewer.
The following screenshot shows an octree probe set solved with base LOD level 4. Here, probes at LOD levels 4-6 are solved, shown in grey. Probes at a higher level of detail are unsolved (LOD levels 0 - 3, shown in red).
The probe set is solved at the specified update rate. This also occurs when the probe LOD feature is not used, but when using the feature only a subset of probes in the probe set are solved.
Higher-detail LODs
Because probe solving and interpolation are decoupled, there can be a problem when the rendering thread is ready to sample from higher-detailed levels when they have not yet been solved. This will typically happen as the camera approaches an area lit by probes and the renderer chooses to sample the light with higher detail.
Instead of stalling the rendering thread while those levels are solved, it is recommended to regularly solve higher levels of detail so that some data is always available (albeit slightly out of date).
The High Level Runtime API has a facility for specifying the rate at which higher-detail LODs are updated.
Solving Probe Sets at Runtime
High-Level Runtime
To set the base LOD level for solving the probe set, use the SetLod
member function available from the BaseProbeSet
class. To do this, call the BaseProbeSet::SetLod(lod) function, and set the value of the lod parameter.
The steps for solving a probe set for a specific LOD level are:
- Allocate the probe set and add it to the Update Manager.
- Call the
BaseProbeSet::SetLod
function on the probe set, specifying the LOD level to solve for. The default level is zero. - Optionally, call the
BaseProbeSet::SetFramesPerUpdate
function and specify how often to solve the probe set at the base LOD. - Optionally, call the
BaseProbeSet::SetFramesPerUpdateForLod
function on the probe set, specifying how often to solve the probe set at higher-detail levels than the base LOD.
When the next solve occurs, the probe set will then be solved at the specified LOD level.
Low-Level Runtime
To instruct the solver to solve a probe set at an LOD level other than LOD0, use the use the m_SelectedLod
and m_LastSolvedLod
members of the EntireProbeSetTask
class.
The steps for solving a probe set for a specific LOD level are:
- Set the
EntireProbeSetTask::m_SelectedLod
member to the specific LOD level. - Set the
EntireProbeSetTask::m_LastSolvedLod
member to the value that was previously used for solving this probe set.
It is important that them_LastSolvedLod
parameter is set to enable the correct handling of temporal coherence. - Call
SolveEntireProbeSetTask
.
Probe Interpolation
The Enlighten Probe interpolation API has only limited support for probe LOD and in order to fully take advantage of the feature you may wish to implement a custom probe interpolation solution.
In order to determine the probes desired for interpolation, use the helper functions GetOctreeNumLods
, GetOctreeNumProbesLod
, GetOctreeNumVirtualProbesLod
, as follows:
- To determine the total number of LOD levels for the probe set, call
GetOctreeNumLods
. - For each LOD level, call
GetOctreeNumProbesLod
to determine the number of real probes at this LOD level. - For each LOD level, call
GetOctreeNumVirtualProbesLod
to determine the number of virtual probes at this LOD level.
The following can be safely assumed:
- All real or virtual probes are ordered from the lowest-detail to the highest-detailed, so that the probes at
GetOctreeNumLods(...)-1
will be first, followed byGetOctreeNumLods(...)-2
, and so on. This occurs all the way down to 0, which is the highest-detail LOD. - Any probe with an index greater than or equal to
RadProbeSetMetaData::m_NumProbes
is a virtual probe.
In order to simplify the process of choosing which probes to sample from, it is recommended to sample from probes in the LOD corresponding to the setting used to solve the probes. However, a solve at a new base LOD level triggered by setting m_SelectedLod
could still be pending. It is therefore recommended to regularly solve higher-detail LODs at a low update rate. This will allow interpolation to proceed with slightly stale data.
Probe bounce and destruction
For both probe bounce and destruction, indirect lighting is sampled from nearby probes. When solving a probe set at a lower-detail LOD, this bounce resampling needs to be aware of the LOD level.
High-Level Runtime
The High-Level Runtime can perform bounce resampling automatically. When using the probe LOD together with probe bounce or destruction, enable the option m_UseProbeSetLod
in the the UpdateManagerProperties
. When this option is enabled, the BaseSystem allocates memory for the interpolants, for each LOD.
During Enlighten updates, InterpolationInputSets
determines which LOD level is used from the value of BaseProbeSet::m_SelectedLod
.
Low-Level Runtime
Call UpdateProbeBounceBuffer
to resample bounce from the specified probe sets. The ProbeBounceWorkspace
must be created with a number of LODs corresponding to the lowest-detail LOD index that will be solved, plus one.
GeoRadiosity Support
GeoRadiosity has some Lua commands that are useful for debugging probe LOD solving.
For example:
app.SetProbeSetLod(probeSetIndex, lodLevel)
.
This allows hard-coded LOD solve values to be set for a specific probe set, or all of them by settingprobeSetIndex = -1
.app.SetProbeSetFramesPerUpdate(probeSetIndex
, framesPerUpdate, baseLevel).
This allows the update rate to be set for either the current base LOD or higher-detail levels for either a specific probe set, or all of them by settingprobeSetIndex = -1
.
For more information, see Lua bindings reference.