This is the documentation for Enlighten.
Sample implementation
To show how to implement basic Enlighten indirect lighting, we provide an extremely simplified example of a real world application such as a game engine.
A typical game engine includes a build pipeline which takes source scene data and produces runtime scene data for consumption by the game runtime. The build pipeline runs on developer machines, while the game runtime runs on target hardware.
To make this separation between pipeline and runtime clear, the sample implementation is divided into two parts: Sample Pipeline and Sample Runtime.
Execute the sample
Pre-built executables for the Sample Pipeline and Sample Runtime applications are found in Bin\Win64*. The full source code is found in Src\Samples\Programs.
Use Sample Pipeline to generate the runtime scene data MinimalExample.rss from the source scene data MinimalExample.fbx:
SamplePipeline.exe Resources\MinimalExample.fbx
Use Sample Runtime to load and display the runtime scene data MinimalExample.rss.
SampleRuntime.exe build\Output\MinimalExample\MinimalExample.rss
Navigate the source
The sample applications use the sample framework libraries GeoBase, GeoCore, GeoApp and GeoRender to implement a simple Windows application.
Some parts of the sample implementation are separated into the sample framework libraries GeoPipeline and GeoRuntime to allow sharing with other sample applications.
This sample implementation favours simplicity over efficiency and robustness and is not intended as a production quality implementation.
We recommend not to use the GeoPipeline and GeoRuntime libraries in production code.
The items highlighted with below represent functionality that should already exist within your engine.
When you implement Enlighten within your engine, we recommend to use your engine's existing solution for source scene data and runtime scene data.
Sample Pipeline
This application represents the build pipeline of a typical game engine. The implementation uses the Pipeline library to drive the precompute.
The source code is organised as described below:
- Main: The high level pipeline steps to export the Enlighten scene, run the precompute and extract the Enlighten runtime data.
- (GeoRuntime) GeoEngine::Mesh and GeoEngine::SampleScene: Basic runtime scene data that can be written to and read from disk.
- (GeoFbx) GeoEngine::LoadFbx: Load source scene data from disk.
- (GeoRuntime) GeoEngine::EnlightenRuntimeData: Basic Enlighten runtime data that can be written to and read from disk.
- (GeoPipeline) GeoEngine::CreateEnlightenScene: Export the intermediate Enlighten scene for the precompute.
- (GeoPipeline) GeoEngine::CreateRuntimeData: Create persistent Enlighten runtime data from the results of the precompute.
- (GeoPipeline) GeoEngine::CreateMaterialColourData: Augment the Enlighten runtime data with material colour data.
Sample Runtime
This application represents the final game runtime of a typical game engine. The implementation uses the high level runtime to perform radiosity updates.
The parts required to enable Enlighten indirect lighting in Main.cpp are wrapped by #if ENLIGHTEN
conditional blocks.
To build the sample implementation without Enlighten indirect lighting, define ENLIGHTEN
to be zero in Main.cpp.
The source code is organised as described below:
- Main: The high level application logic which can load and display a scene with Enlighten indirect lighting.
- ApplicationRuntime: Encapsulates some implementation details of the application.
- EnlightenRuntime: Encapsulates Enlighten-specific functionality to load Enlighten runtime data, drive the high level runtime and render with Enlighten indirect lighting.
- (GeoRuntime) GeoEngine::Dx11GpuTexture: A DX11 implementation of IGpuTexture for use with the high level runtime.
- (GeoRuntime) GeoEngine::PppiDx11TextureUpdateHandler: A DX11 implementation of IPppiTextureUpdateHandler for use with per pixel probe lighting.