This is the documentation for Enlighten.

module Extended Input Lighting

The extended input lighting api.

Classes

Name Description
Enlighten::DirectInputLightingParameters

A class containing the parameters to be used as input to the direct input lighting stage.

Enlighten::IncidentLightingBuffer

A buffer containing the incident lighting for a system's input sample points (internal).

Enlighten::IndirectInputLightingParameters

A class containing the parameters to be used as input to the indirect input lighting stage.

Enlighten::ProbeBounceBuffer

Probe bounce workspace.

Enlighten::TransparencyWorkspace

Workspace used for authored destruction of lightmapped geometry (internal).

Functions

Name Description
AddDusterValuesToInputWorkspace(const InputWorkspace *, Enlighten::IncidentLightingBuffer *, const Geo::v128 *)

Adds light values laid out in a duster block to an Enlighten input workspace.

ApplyVolumeTransparency(const InputWorkspace *, TransparencyWorkspace *, const SphereVolume &)

Mark the quads transparency value using a sphere volume.

ApplyVolumeTransparency(const InputWorkspace *, TransparencyWorkspace *, const BoxVolume &)

Mark the quads transparency value using a box volume.

CalcBounceBufferSize(const Enlighten::InputWorkspace *, PrecisionHint::Value)

Tells you the amount of memory required to hold bounce lighting for a given system.

CalcIncidentLightingBufferSize(const Enlighten::InputWorkspace *, PrecisionHint::Value)

Tells you the amount of memory required to hold incident lighting for a given system.

CalcProbeBounceWorkspaceSize(const Enlighten::InputWorkspace *, Geo::s32)

Tells you the amount of memory required for the probe bounce buffer for a given system.

CalcProbeBounceWorkspaceSize(const Enlighten::InputWorkspace *, Geo::s32, Geo::s32)

Tells you the amount of memory required for the probe bounce buffer for a given system.

CalcRequiredScratchSpaceMemory(InputLightBase **, Geo::u32)

Calculate how much scratchspace memory will be required by the DoDirectInputLighting() function given the lights to be shaded.

CalcTransparencyWorkspaceSize(const InputWorkspace *, Geo::s32, PrecisionHint::Value)

Tells you the amount of memory required for the transparency workspace for a given system.

CalcTransparencyWorkspaceSize(const InputWorkspace *, Geo::s32, Geo::s32, PrecisionHint::Value)

Tells you the amount of memory required for the transparency workspace for a given system.

CompareBounceBuffers(Geo::Statistics &, const Enlighten::BounceBuffer *, const Enlighten::BounceBuffer *)

Compares Returns true if the bounce buffers could be compared.

CompareIncidentLightingBuffers(Geo::Statistics &, const Enlighten::IncidentLightingBuffer *, const Enlighten::IncidentLightingBuffer *)

Compares Returns true if the lighting buffers could be compared.

CreateBounceBuffer(void *, const Enlighten::InputWorkspace *, PrecisionHint::Value)

Construct a BounceBuffer inside the memory provided.

CreateIncidentLightingBuffer(void *, const Enlighten::InputWorkspace *, PrecisionHint::Value)

Construct an IncidentLightingBuffer inside the memory provided.

CreateProbeBounceWorkspace(void *, const Enlighten::InputWorkspace *, Geo::s32, Geo::s32)

Construct a ProbeBounceBuffer inside the memory provided.

CreateProbeBounceWorkspace(void *, const Enlighten::InputWorkspace *, Geo::s32)

Construct a ProbeBounceBuffer inside the memory provided.

CreateTransparencyWorkspace(void *, const InputWorkspace *, Geo::s32, PrecisionHint::Value)

Construct an TransparencyWorkspace inside the memory provided.

CreateTransparencyWorkspace(void *, const InputWorkspace *, Geo::s32, Geo::s32, PrecisionHint::Value)

Construct an TransparencyWorkspace inside the memory provided.

DoDirectInputLighting(DirectInputLightingParameters *, void *, size_t, Geo::u32 &)

Do the Direct input lighting stage.

DoIndirectInputLighting(IndirectInputLightingParameters *, Geo::u32 &)

Do the indirect input lighting stage.

GetBounceBufferSize(const Enlighten::BounceBuffer *, PrecisionHint::Value)

Returns the size of the specified BounceBuffer object.

GetBounceBufferSystemId(const Enlighten::BounceBuffer *)

Get system id from BounceBuffer.

GetIncidentLightingBufferSize(const Enlighten::IncidentLightingBuffer *, PrecisionHint::Value)

Returns the size of the specified IncidentLightingBuffer object.

GetIncidentLightingBufferSystemId(const Enlighten::IncidentLightingBuffer *)

Get system id from IncidentLightingBuffer.

SetTransparency(const InputWorkspace *, TransparencyWorkspace *, float)

Set all transparency values of transparencyWorkspace to the given value.

UpdateProbeBounceBuffer(const InputWorkspace *, Enlighten::ProbeBounceWorkspace *, Enlighten::BounceBuffer *, const InterpolationInputSet *, Geo::s32, bool, Geo::u32 &)

Update the probe bounce buffer with values calculated from interpolated probes.

UpdateProbeBounceBuffer(const InputWorkspace *, Enlighten::ProbeBounceWorkspace *, Enlighten::BounceBuffer *, Enlighten::IProbeSetManager *, bool, Geo::u32 &)

Update the probe bounce buffer with values calculated from interpolated probes.

UpdateTransparencyWorkspace(const InputWorkspace *, TransparencyWorkspace *, const InterpolationInputSet *, Geo::s32, bool)

Update the transparency workspace with values calculated from interpolated probes.

UpdateTransparencyWorkspace(const InputWorkspace *, TransparencyWorkspace *, Enlighten::IProbeSetManager *, bool)

Update the transparency workspace with values calculated from interpolated probes.

VerifyBounceBufferData(const Enlighten::BounceBuffer *)

Returns true if there are no NaN's or non-finite numbers in the specified BounceBuffer object.

VerifyIncidentLightingBufferData(const Enlighten::IncidentLightingBuffer *)

Returns true if there are no NaN's or non-finite numbers in the specified InputLightingBuffer object.


bool GEO_CALL Enlighten::AddDusterValuesToInputWorkspace


public: bool GEO_CALL AddDusterValuesToInputWorkspace
(
    const InputWorkspace * workspaceMemory,
    Enlighten::IncidentLightingBuffer * output,
    const Geo::v128 * dusterValues
)


Adds light values laid out in a duster block to an Enlighten input workspace.

Parameters
[in] workspaceMemory

The input workspace memory block.

[in] output

The incident lighting buffer to fill with data.

[in] dusterValues

The linear light colour values for the duster array of point samples. The duster (its size, positions, normals etc.) must match the one originally passed to CreateInputWorkspace.


void GEO_CALL Enlighten::ApplyVolumeTransparency


public: void GEO_CALL ApplyVolumeTransparency
(
    const InputWorkspace * inputWorkspace,
    TransparencyWorkspace * transparencyWorkspace,
    const SphereVolume & volume
)


Mark the quads transparency value using a sphere volume.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] transparencyWorkspace

The TransparencyWorkspace for the system

[in] volume

The volume primitive to use to mark the quads


void GEO_CALL Enlighten::ApplyVolumeTransparency


public: void GEO_CALL ApplyVolumeTransparency
(
    const InputWorkspace * inputWorkspace,
    TransparencyWorkspace * transparencyWorkspace,
    const BoxVolume & volume
)


Mark the quads transparency value using a box volume.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] transparencyWorkspace

The TransparencyWorkspace for the system

[in] volume

The volume primitive to use to mark the quads


Geo::u32 GEO_CALL Enlighten::CalcBounceBufferSize


public: Geo::u32GEO_CALL CalcBounceBufferSize
(
    const Enlighten::InputWorkspace * inputWorkspace,
    PrecisionHint::Value precision
)


Tells you the amount of memory required to hold bounce lighting for a given system.

Parameters
[in] inputWorkspace

The InputWorkspace for the system.

[in] precision

The hint to what floating point precision to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


Geo::u32 GEO_CALL Enlighten::CalcIncidentLightingBufferSize


public: Geo::u32GEO_CALL CalcIncidentLightingBufferSize
(
    const Enlighten::InputWorkspace * inputWorkspace,
    PrecisionHint::Value precision
)


Tells you the amount of memory required to hold incident lighting for a given system.

Parameters
[in] inputWorkspace

The InputWorkspace for the system.

[in] precision

The hint to what floating point precision to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


Geo::u32 GEO_CALL Enlighten::CalcProbeBounceWorkspaceSize


public: Geo::u32GEO_CALL CalcProbeBounceWorkspaceSize
(
    const Enlighten::InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants
)


Tells you the amount of memory required for the probe bounce buffer for a given system.

Parameters
[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


Geo::u32 GEO_CALL Enlighten::CalcProbeBounceWorkspaceSize


public: Geo::u32GEO_CALL CalcProbeBounceWorkspaceSize
(
    const Enlighten::InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants,
    Geo::s32 numLods
)


Tells you the amount of memory required for the probe bounce buffer for a given system.

Parameters
[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

[in] numLods

The number of LODs to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


size_t Enlighten::CalcRequiredScratchSpaceMemory


public: size_t CalcRequiredScratchSpaceMemory
(
    InputLightBase ** lights,
    Geo::u32 numLights
)


Calculate how much scratchspace memory will be required by the DoDirectInputLighting() function given the lights to be shaded.

Parameters
[in] lights

An array of pointers to input lights.

[in] numLights

The number of light pointers in the array.

Returns

Required memory in bytes


Geo::u32 GEO_CALL Enlighten::CalcTransparencyWorkspaceSize


public: Geo::u32GEO_CALL CalcTransparencyWorkspaceSize
(
    const InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants,
    PrecisionHint::Value precision
)


Tells you the amount of memory required for the transparency workspace for a given system.

Parameters
[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

[in] precision

The floating point precision for intermediate values.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


Geo::u32 GEO_CALL Enlighten::CalcTransparencyWorkspaceSize


public: Geo::u32GEO_CALL CalcTransparencyWorkspaceSize
(
    const InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants,
    Geo::s32 numLods,
    PrecisionHint::Value precision
)


Tells you the amount of memory required for the transparency workspace for a given system.

Parameters
[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

[in] precision

The floating point precision for intermediate values.

[in] numLods

The number of LODs to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


bool GEO_CALL Enlighten::CompareBounceBuffers


public: bool GEO_CALL CompareBounceBuffers
(
    Geo::Statistics & res,
    const Enlighten::BounceBuffer * bufA,
    const Enlighten::BounceBuffer * bufB
)


Compares Returns true if the bounce buffers could be compared.

Parameters
[inout] res

- The result of the comparison. Only written if the function succeeded.

[in] bufA

- The first BounceBuffer to compare.

[in] bufB

- The second BounceBuffer to compare.


bool GEO_CALL Enlighten::CompareIncidentLightingBuffers


public: bool GEO_CALL CompareIncidentLightingBuffers
(
    Geo::Statistics & res,
    const Enlighten::IncidentLightingBuffer * bufA,
    const Enlighten::IncidentLightingBuffer * bufB
)


Compares Returns true if the lighting buffers could be compared.

Parameters
[inout] res

- The result of the comparison. Only written if the function succeeded.

[in] bufA

- The first IncidentLightingBuffer to compare.

[in] bufB

- The second IncidentLightingBuffer to compare.


Enlighten::BounceBuffer* GEO_CALL Enlighten::CreateBounceBuffer


public: Enlighten::BounceBuffer *GEO_CALL CreateBounceBuffer
(
    void * memory,
    const Enlighten::InputWorkspace * inputWorkspace,
    PrecisionHint::Value precision
)


Construct a BounceBuffer inside the memory provided.

Parameters
[in] memory

A block of memory (size determined by CalcBounceBufferSize) to store the bounce buffer

[in] inputWorkspace

The InputWorkspace for the system.

[in] precision

The hint to what floating point precision to use.


Enlighten::IncidentLightingBuffer* GEO_CALL Enlighten::CreateIncidentLightingBuffer


public: Enlighten::IncidentLightingBuffer *GEO_CALL CreateIncidentLightingBuffer
(
    void * memory,
    const Enlighten::InputWorkspace * inputWorkspace,
    PrecisionHint::Value precision
)


Construct an IncidentLightingBuffer inside the memory provided.

Parameters
[in] memory

A block of memory (size determined by CalcIncidentLightingBufferSize) to store the lighting buffer

[in] inputWorkspace

The InputWorkspace for the system.

[in] precision

The hint to what floating point precision to use.


Enlighten::ProbeBounceWorkspace* GEO_CALL Enlighten::CreateProbeBounceWorkspace


public: Enlighten::ProbeBounceWorkspace *GEO_CALL CreateProbeBounceWorkspace
(
    void * memory,
    const Enlighten::InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants,
    Geo::s32 numLods
)


Construct a ProbeBounceBuffer inside the memory provided.

Parameters
[in] memory

A block of memory (size determined by CalcProbeBounceBufferSize) to store the workspace for a probe-lit system.

[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

[in] numLods

The number of LODs to use.


Enlighten::ProbeBounceWorkspace* GEO_CALL Enlighten::CreateProbeBounceWorkspace


public: Enlighten::ProbeBounceWorkspace *GEO_CALL CreateProbeBounceWorkspace
(
    void * memory,
    const Enlighten::InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants
)


Construct a ProbeBounceBuffer inside the memory provided.

Parameters
[in] memory

A block of memory (size determined by CalcProbeBounceBufferSize) to store the workspace for a probe-lit system.

[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.


TransparencyWorkspace* GEO_CALL Enlighten::CreateTransparencyWorkspace


public: TransparencyWorkspace *GEO_CALL CreateTransparencyWorkspace
(
    void * memory,
    const InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants,
    PrecisionHint::Value precision
)


Construct an TransparencyWorkspace inside the memory provided.

Parameters
[in] memory

A block of memory (size determined by CalcTransparencyWorkspaceSize) to store the workspace for pre-authored static destruction/transparency

[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

[in] precision

The floating point precision for intermediate values.


TransparencyWorkspace* GEO_CALL Enlighten::CreateTransparencyWorkspace


public: TransparencyWorkspace *GEO_CALL CreateTransparencyWorkspace
(
    void * memory,
    const InputWorkspace * inputWorkspace,
    Geo::s32 numInterpolants,
    Geo::s32 numLods,
    PrecisionHint::Value precision
)


Construct an TransparencyWorkspace inside the memory provided.

Parameters
[in] memory

A block of memory (size determined by CalcTransparencyWorkspaceSize) to store the workspace for pre-authored static destruction/transparency

[in] inputWorkspace

The InputWorkspace for the system.

[in] numInterpolants

The maximum number of interpolants to use.

[in] precision

The floating point precision for intermediate values.

[in] numLods

The number of LODs to use.


bool Enlighten::DoDirectInputLighting


public: bool DoDirectInputLighting
(
    DirectInputLightingParameters * params,
    void * scratchspace,
    size_t scratchspacSize,
    Geo::u32 & timeUs
)


Do the Direct input lighting stage.

Parameters
[in] params

A pointer to a complete DirectInputLightingParams object.

[in] scratchspace

A pointer to allocated scratchspace memory. This memory is only used for the duration of the call to this function.

[in] scratchspacSize

The size of the scratchspace memory calculated with CalcRequiredScratchSpaceMemory function.

[out] timeUs

Duration taken to solve the indirect input lighting phase.

Returns

true on success


bool Enlighten::DoIndirectInputLighting


public: bool DoIndirectInputLighting
(
    IndirectInputLightingParameters * params,
    Geo::u32 & timeUs
)


Do the indirect input lighting stage.

Parameters
[in] params

A pointer to a complete IndirectInputLightingParameters object.

[out] timeUs

Duration taken to solve the indirect input lighting phase.

Returns

true on success


Geo::u32 GEO_CALL Enlighten::GetBounceBufferSize


public: Geo::u32GEO_CALL GetBounceBufferSize
(
    const Enlighten::BounceBuffer * bounceBuffer,
    PrecisionHint::Value precision
)


Returns the size of the specified BounceBuffer object.

Parameters
[in] bounceBuffer

The BounceBuffer to query.

[in] precision

The hint to what floating point precision to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


Geo::GeoGuid GEO_CALL Enlighten::GetBounceBufferSystemId


public: Geo::GeoGuidGEO_CALL GetBounceBufferSystemId
(
    const Enlighten::BounceBuffer * bounceBuffer
)


Get system id from BounceBuffer.

Parameters
[in] bounceBuffer

The BounceBuffer to query.


Geo::u32 GEO_CALL Enlighten::GetIncidentLightingBufferSize


public: Geo::u32GEO_CALL GetIncidentLightingBufferSize
(
    const Enlighten::IncidentLightingBuffer * incidentLightingBuffer,
    PrecisionHint::Value precision
)


Returns the size of the specified IncidentLightingBuffer object.

Parameters
[in] incidentLightingBuffer

The IncidentLightingBuffer to query.

[in] precision

The hint to what floating point precision to use.

Returns

Required memory in bytes, 0xFFFFFFFF upon error.


Geo::GeoGuid GEO_CALL Enlighten::GetIncidentLightingBufferSystemId


public: Geo::GeoGuidGEO_CALL GetIncidentLightingBufferSystemId
(
    const Enlighten::IncidentLightingBuffer * incidentLightingBuffer
)


Get system id from IncidentLightingBuffer.

Parameters
[in] incidentLightingBuffer

The IncidentLightingBuffer to query.


bool GEO_CALL Enlighten::SetTransparency


public: bool GEO_CALL SetTransparency
(
    const InputWorkspace * inputWorkspace,
    TransparencyWorkspace * transparencyWorkspace,
    float transparencyValue
)


Set all transparency values of transparencyWorkspace to the given value.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] transparencyWorkspace

The TransparencyWorkspace for the system

[in] transparencyValue

The value to reset all the quads in this system to


bool GEO_CALL Enlighten::UpdateProbeBounceBuffer


public: bool GEO_CALL UpdateProbeBounceBuffer
(
    const InputWorkspace * inputWorkspace,
    Enlighten::ProbeBounceWorkspace * probeBounceWorkspace,
    Enlighten::BounceBuffer * bounceBufferOutput,
    const InterpolationInputSet * interpolationInputs,
    Geo::s32 numInterpolationInputs,
    bool recomputeInterpolants,
    Geo::u32 & timeUs
)


Update the probe bounce buffer with values calculated from interpolated probes.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] probeBounceWorkspace

The buffer where intermediate probe interpolation calculations are stored

[out] bounceBufferOutput

The buffer where the bounce values are written to. This is the input buffer to the IndirectInputLighting stage.

[in] interpolationInputs

An array of probesets to interpolate from

[in] numInterpolationInputs

The number of probesets in the array

[in] recomputeInterpolants

Whether or not to recompute the interpolants

[out] timeUs

Duration taken to update the probe bounce buffer.

Returns

TRUE if successful, FALSE on error


bool GEO_CALL Enlighten::UpdateProbeBounceBuffer


public: bool GEO_CALL UpdateProbeBounceBuffer
(
    const InputWorkspace * inputWorkspace,
    Enlighten::ProbeBounceWorkspace * probeBounceWorkspace,
    Enlighten::BounceBuffer * bounceBufferOutput,
    Enlighten::IProbeSetManager * probeSetManager,
    bool recomputeInterpolants,
    Geo::u32 & timeUs
)


Update the probe bounce buffer with values calculated from interpolated probes.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] probeBounceWorkspace

The buffer where intermediate probe interpolation calculations are stored

[out] bounceBufferOutput

The buffer where the bounce values are written to. This is the input buffer to the IndirectInputLighting stage.

[in] probeSetManager

The Probe Set Manager object that provides interface for probe interpolation

[in] recomputeInterpolants

Whether or not to recompute the interpolants

[out] timeUs

Duration taken to update the probe bounce buffer.

Returns

TRUE if successful, FALSE on error


void GEO_CALL Enlighten::UpdateTransparencyWorkspace


public: void GEO_CALL UpdateTransparencyWorkspace
(
    const InputWorkspace * inputWorkspace,
    TransparencyWorkspace * transparencyWorkspace,
    const InterpolationInputSet * interpolationInputs,
    Geo::s32 numInterpolationInputs,
    bool recomputeInterpolants
)


Update the transparency workspace with values calculated from interpolated probes.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] transparencyWorkspace

The workspace where intermediate probe results and other calculation results are stored

[in] interpolationInputs

An array of probesets to interpolate from

[in] numInterpolationInputs

The number of probesets in the array

[in] recomputeInterpolants

Whether or not to recompute the interpolants


void GEO_CALL Enlighten::UpdateTransparencyWorkspace


public: void GEO_CALL UpdateTransparencyWorkspace
(
    const InputWorkspace * inputWorkspace,
    TransparencyWorkspace * transparencyWorkspace,
    Enlighten::IProbeSetManager * probeSetManager,
    bool recomputeInterpolants
)


Update the transparency workspace with values calculated from interpolated probes.

Parameters
[in] inputWorkspace

The input workspace for the system

[out] transparencyWorkspace

The workspace where intermediate probe results and other calculation results are stored

[in] probeSetManager

The Probe Set Manager object that provides interface for probe interpolation

[in] recomputeInterpolants

Whether or not to recompute the interpolants


bool GEO_CALL Enlighten::VerifyBounceBufferData


public: bool GEO_CALL VerifyBounceBufferData
(
    const Enlighten::BounceBuffer * bounceBuffer
)


Returns true if there are no NaN's or non-finite numbers in the specified BounceBuffer object.

Parameters
[in] bounceBuffer

The BounceBuffer to query.


bool GEO_CALL Enlighten::VerifyIncidentLightingBufferData


public: bool GEO_CALL VerifyIncidentLightingBufferData
(
    const Enlighten::IncidentLightingBuffer * incidentLightingBuffer
)


Returns true if there are no NaN's or non-finite numbers in the specified InputLightingBuffer object.

Parameters
[in] incidentLightingBuffer

The IncidentLightingBuffer to query.