Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
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:
- for each lightmap UV set
- for each lightmap-lit system
- lightmap-lit system radiosity data
- for each probe-lit system
- probe-lit system radiosity data
- for each lightmap-lit instance
- instance GUID
- pointer to lightmap UV set
- lightmap UV transform
- index of lightmap-lit system
- for each probe set
- probe set radiosity data
- for each cubemap
- cubemap radiosity data
Tip |
---|
We recommend to compress each chunk of persistent runtime data on disk to save space and speed up loading. |
...