This is the documentation for Enlighten.

Baking parameters

Baking parameters are specified in a .bp XML file, separate to your .scene file. The format of this file is described below, and the full XML schema definitions for this file are available in <Enlighten_install_directory>\Src\Samples\Libraries\GeoEn2Support\bp.xsd.

<bakeParamsList>

Your bake parameters must be enclosed in a <bakeParamsList> element, with the following attributes:

Attribute

Optionality

Description

Value

version

Required

The version of the bake parameters list.

1

albedoRendered

Optional

Determines whether the application should render albedo textures per-EnlightenSystem, or per-BakeSystem.

BakeSystems / EnlightenSystems
(default BakeSystems)

enableDirectionality

Optional

If true, generates directional light maps for three additional normals, which must be supplied by the user. If you are using .mesh files, these files are required to contain tangent space information, and the HLBS generates the standard Half-Life 2 normal vectors. If you are using .pim files, for each .pim file a separate .normals file must be generated with three normals.

false

<bakeParams>

The <bakeParams> element contains the parameters to be passed to the EnlightenBake API, with several optional child elements to govern direct and indirect light baking, as well as solver and AO behaviour.

The <bakeParams> element supports the following attributes:

Attribute

Optionality

Description

Value

name

Required

The name of the bake parameter set.

String

resolution

Required

The resolution of the created baked lightmap.

2-element power-of-two vector
(eg. 512 512)

guid

Optional

The GUID of the bake parameter set.

String

pushOff

Optional

Push off for ray casting. It is not recommended to change this unless advised by Enlighten support.

Positive float

packUVs

Optional

Determines whether the lightmap UVs of the different instances will be packed. By default, instances have their chart UVs passed to the baking stage unmodified. If they overlap in the 0--1 range, the resulting lightmap will be incorrect. By enabling packUVs, the first stage will generate valid UVs for the instances in the lightmap, which you can read and use to generate albedo textures before continuing.

Boolean
(default false)

outputType

Optional

The desired type of baking output. The output will always be available as a 2D texture. If vertex, the texels correspond to the vertex array.

texture / vertex
(default texture)

outputIsIntensity

Optional

Instead of outputing the irradiance, that is the weighted sum of all incoming radiance, the light map will contain an intensity value. If you place a light source in the dominant direction of the lighting, which can be retrieved from the baked directional irradiance map, and use the intensity stored in the light map, the resulting irradiance will be identical to the result Enlighten normally outputs. This allows you to easily use any kind of BRDF to relight surfaces, especially more specular BRDFs. There are certain caveats to look out for when using this mode and we recommend using cube maps when using specular BRDFs. Please contact Enlighten Support if you intend to use this feature.

Boolean
(default false)

shadowFaces

Optional

Deprecated: The type of faces that cast shadows in the direct lighting tasks. This flag should represent how your runtime creates shadow maps.
This has moved to the shadowfaceBehaviourType attribute in the materials API. Please use the new location. To aid migration, this setting will override settings in the new location.

back, front, both, bothWithInvalidBack or useMaterialAPI
(default useMaterialAPI)

backFaceTolerance

Optional

Set the tolerance value for marking a pixel as invalid in baking. Behaves similar to the back face tolerance in the radiosity precompute.

Positive float

enableFinalGather

Optional

Enable final gather as a high-quality post-processing step run after the default upsampling.

Boolean
(default true)

enableDirectionalIrradiance

Optional

If 'true', will generate directional irradiance maps used for relighting of normal mapped geometry.

Boolean
(default true)

enableLegacyRelighting

Optional

Deprecated: If 'true', will use the legacy surface relighting model, which had been the default up to Enlighten 3.02. The new relighting model produces better quality with more complex geometry.

Boolean
(default false)

unitScale

Optional

Deprecated. Has no effect.

Positive float

mosaicResolution

Optional

Deprecated. Has no effect.

2-element vector

The <bakeParams> element supports the following child elements:

<direct>

These properties affect only the direct light baking.

Attribute

Optionality

Description

Value

maxAASamples

Optional

The number of samples to take per-pixel in order to reduce aliasing. This is the maximum number of times to supersample a lightmap pixel. For preview bakes, a value of 1 is sufficient, but you may notice jagged shadow edges in the output. The default value removes the majority of aliasing issues. For large scenes with lots of lights, halving this value halves the baking time.

Positive integer
(default 8)

maxLightSamples

Optional

The number of samples to take per-area light in order to capture soft shadowing effects. This is the maximum number of rays to trace to any light with an area. Larger area lights will require more rays to produce noise-free output. The default value works with the majority of scene setups, but you should increase this value if you observe noise. Like maxAASamples, it can have a significant impact on performance, and for large scenes with lots of area lights, halving this value halves the baking time.

Positive integer
(default 64)

postProcessingFilterSize

Optional

The size of the radius of the post-processing filter in pixels that blurs the direct light baking. The filter is aware of geometry and visibility between pixels and thus no light leaking will occur. The filter allows otherwise sharp shadows to be smoothed without the need to use area light sources. In general, a value in the range of 2 and 8 leads to good results. Note that the processing time depends on the filter size squared and thus larger values should be avoided.

Positive integer
(default 0)

tileCullingThreshold

Optional

Threshold value for BakeVisibility tile culling.
For internal use only. We recommend to only change this parameter when advised by Enlighten Support.

Positive float or 0. (default 0.001)

<indirect>

These properties affect only the indirect light baking.

Attribute

Optionality

Description

Value

numProbeInterpolants

Optional

The maximum number of probes to use when interpolating probes for bounding box corners when lifting indirect lighting from probes into lightmaps. The default is 8, which gives good results. You may need to decrease this when using sparse probes or probes laid out in grids or single rows.

Positive integer
(default 8)

enableVisibilityAwareUpsampling

Optional

Whether to enable visibility aware upsampling. This ensures that radiosity upsampling takes the visibility of the sample points of the radiosity samples and the sample points of the baked light map into account. This allows Enlighten to avoid interpolating from radiosity pixels whose samples are on the other side of a wall to the sample points of the baked light map pixel. You can only enable this feature if your light map only contains target meshes. If you enable it on a light map that, for example, contains a detail mesh, the feature will be automatically disabled and a warning generated.

Boolean
(default false)

finalGatherQuality

Optional

The number of rays to cast for each output pixel during final gather.

Positive integer
(default 512)

finalGatherNumSamples

Optional

The number of samples to cast rays from for each output pixel during final gather.

Positive integer
(default 16)

finalGatherTransparency

Optional

Enable the evaluation of transparency during final gather. Results might be inconsistent with real-time output.

Boolean
(default true)

finalGatherPostFiltering

Optional

Perform filtering after final gather to remove noise.

Boolean
(default true)

<ao>

These properties affect the AO baking.

Attribute

Optionality

Description

Value

distance

Optional

The distance to search for occluders. This value sets a distance below which a point is considered occluded. When the hemisphere is searched for occlusion, any ray that intersects geometry within this distance adds to the total occlusion value for the point, making it appear darker. You will want to tune this parameter based on the size of your scene.

Positive float
(default 100)

quality

Optional

The quality (in number of rays to cast) for the AO. Fewer rays produce a noisier result. Usually, using 256 rays produces a smooth result.

Integer (power of 2, min 16, max 131072)

cullingThreshold

Optional

Threshold value for AO pixel culling. If the visibility is less than this value the pixel is rejected and instead interpolated from nearby valid pixels. AO visibility is the proportion of valid (i.e. front-facing) geometry seen by the pixel, where 0 means no valid geometry was seen and 1 means only valid geometry was seen. A value of 0 will disable AO pixel culling. This is the AO counterpart to the backFaceTolerance system parameter. It determines whether to reject a location for AO calculation based on whether the proportion of back facing triangles it can see. A value of 1.0 implies it will reject any location that can see back faces. A value of 0.0 implies that we keep all locations, regardless of how many back faces they may see. Values between these two extremes specify the proportion of the scene visible from that location that must be back facing before the location is culled.

Float between 0 and 1
representing 0% to 100%
(default 0.9)

maxAASamples

Optional

The maximum number of times to supersample a pixel to remove aliasing for AO. Increasing this value does not increase baking times as the number of rays is only defined by the AO quality. Effectively this parameter controls how to distribute the rays in the baking pixel.

Positive integer
(default 16).

<solver>

Attribute

Optionality

Description

Value

forceWhiteAlbedo

Optional

Whether to use white albedo for radiosity computations. Usually the albedo of a surface is defined by the albedo texture provided, or 0.7 if no texture is found. For debugging purposes, it is possible to force this value to 1.0 by setting this property.

Boolean
(default false)

disableEmissive

Optional

Whether to use emissive lighting for the radiosity. If this property is set, there are no emissive surfaces, no matter what emissive texture was supplied.

Boolean
(default false)

Example bake parameters file

<?xml version="1.0" encoding="utf-8"?>
<bakeParamsList version="1">
	<bakeParams name="Interior" resolution="512 512" unitScale="1.0" pushOff="10.0" packUVs="true">
		<direct maxAASamples="8" maxLightSamples="64"/>
		<ao quality="256" distance="500"/>
	</bakeParams>
</bakeParamsList>