This is the documentation for Enlighten.

Bounce Resampling

As of Enlighten 3.00, there is a new mechanism for handling bounce. This replaces the now defunct "high quality bounce" mechanism as well as the previous runtime bounce mechanism. This new bounce mechanism introduces a new function, Enlighten::ResampleBounce(), which is called after the system solver stage is run and before the next frames indirect input lighting stage is run. This new stage re-samples the solve output and populates the contents of a special Enlighten::BounceBuffer with the results. This bounce buffer is then supplied as an input into the IndirectInputLighting stage which completes the frame-to-frame bounce cycle.

There are several advantages to this new mechanism such as reduced light leaking, configurable quality at run-time, full support for all output formats (not only FP16) and all while being orders of magnitude faster than the old high quality bounce mechanism. There is also a special path when the quality is set to 0.0f (lowest) which takes advantage of temporal coherence information to perform the minimum work when updating the bounce buffer. For baking or highest quality bounce, the quality can be set to 1.0f (highest). The improved performance makes this feasible for runtime.

Integration notes

On the RadSystemCore there is a new RadDataBlock section, Iff::ResamplingDataSection, which must be loaded in order for bounce to work. A warning will be printed if the data is not present.

There is a new buffer Enlighten::BounceBuffer which must be created and persists for the life of the system. Much like the InputLightingBuffer and IncidentLightingBuffer, the BounceBuffer supports full 32-bit float precision or half 16-bit precision. See Enlighten::CalcBounceBufferSize() and Enlighten::CreateBounceBuffer().

Lightmap system

There is a new function, Enlighten::ResampleBounce() which must be called after the solver has completed. See Enlighten::ResampleBounce(), class Enlighten::ResampleBounceParameters and class Enlighten::ResampleTextureParams.

Code sample
if (system->m_RadSystemCore)
{
	ResampleBounceParameters bounceParams;
	bounceParams.m_BounceBuffer		= system->m_BounceBuffer;
	bounceParams.m_RadSystemCore	= system->m_RadSystemCore;
	bounceParams.m_PersistentData	= system->m_PresistentDataBuffer;

	ResampleTextureParams hqBounce;
	hqBounce.m_TextureData			= system->GetOutputPointer(ENLIGHTEN_OUTPUT_IRRADIANCE);
	hqBounce.m_TextureWidth			= system->m_RadSystemCore->m_MetaData.m_OutputWidth;
	hqBounce.m_TextureHeight		= system->m_RadSystemCore->m_MetaData.m_OutputHeight;
	hqBounce.m_TexturePitch			= system->GetOutputPitchInBytes(ENLIGHTEN_OUTPUT_IRRADIANCE);
	hqBounce.m_ByteOrder			= m_OutputFormatByteOrder;
	hqBounce.m_TextureFormat		= system->m_OutputFormat;
	hqBounce.m_FixedPointRescale	= IsFixedPointFormat(system->m_OutputFormat) ? m_GlobalState.m_FpFormatRescale : 1.0f;
	hqBounce.m_Quality				= m_GlobalState.m_BounceQuality;
	bounceParams.m_ResampleTextureParams	= &hqBounce;

	Enlighten::ResampleBounce(bounceParams, timeUs);
}

Probe radiosity systems

Systems which update the bounce from probes (rather than lightmaps) also write to the new Enlighten::BounceBuffer. This simplifies the IndirectInputLighting interface and implementation. As a result, Enlighten::ProbeBounceBuffer has been renamed to Enlighten::ProbeBounceWorkspace for clarity. The function Enlighten::UpdateProbeBounceBuffer() now takes an additional input parameter which is the Enlighten::BounceBuffer to write the bounce to.