Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel4
typeflat
printablefalse
separatorpipe

...

The diagram below shows how data flows from the Enlighten scene to the persistent runtime data.

Excerpt
hiddentrue



Image Added

The precompute process stores the result of the precompute in the precomp and radiosity sub-directories within the __Build_<scene>__ directory at the scene root. When the precompute process completes successfully, extract the persistent runtime data from these locations and store it in a form ready to be loaded by the game runtime and editing tools.

...

Note

The exported Enlighten scene and the intermediate data in __Build_<scene>__ are used only by the precompute and debugging tools, and are not required for runtime radiosity updates.

For a prototype implementation you might load files from the __Build_<scene>__ directory directly in your game runtime, but this would not be practical in a production implementation.

Data layout

Enlighten runtime data is grouped into separate objects for each system, probe set and cubemap.

To find the automatically generated systems in a zone, load the IPrecompGeneratedSystems object.

Code Block
// path: "precomp/[zone name].gs"
const Enlighten::IPrecompGeneratedSystems* generatedSystems
	= Geo::LoadInterfaceCompressed<Enlighten::IPrecompGeneratedSystems>(path);

for (Geo::s32 systemIndex = 0; systemIndex != generatedSystems->GetNumSystems(); ++systemIndex)
{
	const Enlighten::IPrecompInputSystem* inputSystem = generatedSystems->GetSystem(systemIndex);
	Geo::GeoFileString systemName(inputSystem->GetName());

	// extract radiosity data associated with this system
}

To find the automatically generated probe sets in a zone, load the IPrecompOutputProbeOctree object.

Code Block
// path: "precomp/[zone name].opo"
const Enlighten::IPrecompOutputProbeOctree* probeOctree
	= Geo::LoadInterfaceCompressed<Enlighten::IPrecompOutputProbeOctree>(path);

for (Geo::s32 probeSetIndex = 0; probeSetIndex != probeOctree->GetNumProbeSets(); ++probeSetIndex)
{
	Geo::GeoFileString probeSetName = Geo::GeoFileString::Printf("%s_%d", probeOctree->GetName(), probeSetIndex);

	// extract radiosity data associated with this probe set
}

...

Tip

If you choose to use explicit system groups or manually placed probes, keep track of the system and probe set names in the same way.

We recommend to combine all systems, probe sets and cubemaps in a single zone into a single chunk for efficient load in your runtime file-system. 

Below is a practical example of the data layout for a single chunk:

Tip

We recommend to compress each chunk of persistent runtime data on disk to save space and speed up loading.

...