This is the documentation for Enlighten.
module Albedo Handling
In order to bounce light from geometry, Enlighten needs some description of the surface colour - the "albedo" of the surface.
Enlighten will use the albedo colour to modulate the input lighting to compute the colour of the bounce light.
Classes
Name | Description |
|---|---|
Constitutes the precomputed material data for a system. | |
A set of initialisers for the dynamicity of surface colours. | |
Specify the albedo/emissive texture resolution relative to the light map resolution. |
Typedefs
Name | Description |
|---|---|
Geo::GeoRGBXTextureElement CpuTextureElement | Structure defining the memory layout of CPU texture data used by Enlighten for texture albedo and emissive. |
Geo::u64 SurfaceSelection | Selects a set of surfaces within a system. |
Functions
Name | Description |
|---|---|
Calculate the size of the AlbedoBuffer for a system. | |
CalcDynamicMaterialWorkspaceSize(const ClusterAlbedoWorkspaceMaterialData *) | Calculate the size of the DynamicMaterialWorkspace. |
Calculate the size of the EmissiveBuffer for a system. | |
CalcTransparencyBufferSize(const Enlighten::InputWorkspace *) | Calculate the size of the TransparencyBuffer for a system. |
CreateAlbedoBuffer(const Enlighten::InputWorkspace *, void *) | Create an AlbedoBuffer for a system. |
Determine the specific material ID for a given instance, mesh and 32-bit material ID. | |
CreateDynamicMaterialWorkspace(const ClusterAlbedoWorkspaceMaterialData *, void *) | Create a DynamicMaterialWorkspace which is used for dynamic updates of material colours at runtime. |
CreateEmissiveBuffer(const Enlighten::InputWorkspace *, void *) | Create an EmissiveBuffer for a system. |
CreateTransparencyBuffer(const Enlighten::InputWorkspace *, void *) | Create a TransparencyBuffer for a system. |
Utility function for converting floating point values to the RGBM format. | |
GetClusterAlbedoWorkspaceMaterialDataSize(const Enlighten::ClusterAlbedoWorkspaceMaterialData *) | Returns the size of the specified ClusterAlbedoWorkspaceMaterialData object. |
GetClusterAlbedoWorkspaceMaterialIds(const Enlighten::ClusterAlbedoWorkspaceMaterialData *) | Returns a list of all material Ids referenced by this albedo workspace. |
GetClusterAlbedoWorkspaceNumMaterials(const Enlighten::ClusterAlbedoWorkspaceMaterialData *) | Returns the number of material Ids referenced by this albedo workspace. |
GetDebugAlbedoValue(const Geo::u32, const AlbedoBuffer *, Geo::v128 &) | Get the cluster albedo value of a debug point from an AlbedoBuffer. |
GetDebugEmissiveValue(const Geo::u32, const EmissiveBuffer *, Geo::v128 &) | Get the cluster emissive value of a debug point from an EmissiveBuffer. |
GetDebugTransparencyValue(const Geo::u32, const TransparencyBuffer *, float &) | Get the cluster transparency value of a debug point from an TransparencyBuffer. |
Returns the required dimensions of the albedo and emissive textures for a given radiosity core. | |
GetTextureSize(const TextureResolutionScale::Value, Geo::s32, Geo::s32, Geo::s32 &, Geo::s32 &) | Inline function that returns the required dimensions of the albedo and emissive textures for a given a texture width and height. |
Sets the albedo colours for an AlbedoBuffer based on the individual sample points. | |
Sets the albedo colours for an AlbedoBuffer from a materialWorkspace. | |
Sets the albedo colours for an AlbedoBuffer from an albedo texture expected in RGBA format in gamma-2 colour space. | |
Sets the emissive colours for an EmissiveBuffer based on the individual sample points. | |
Sets the emissive colours for an EmissiveBuffer from a materialWorkspace. | |
Sets the emissive colours for an EmissiveBuffer from an emissive texture expected in RGBM format in linear colour space. | |
Sets the emissive colours for an EmissiveBuffer from an emissive texture expected in FP16 format in linear colour space. | |
Initialise all the materials of an instance in the DynamicMaterialWorkspace as dynamic. | |
Initialise a material component in the DynamicMaterialWorkspace as static or dynamic. | |
Initialise a material emissive component in the DynamicMaterialWorkspace as dynamic. | |
Initialise all the materials in the DynamicMaterialWorkspace as dynamic. | |
Sets the transparency for a TransparencyBuffer based on the individual sample points. | |
Sets the values for a TransparencyBuffer from a materialWorkspace. | |
Sets the values for a TransparencyBuffer from a the alpha channel in the albedo texture in RGBA format. | |
IsAlbedoBufferInitialiseRequired(const DynamicMaterialWorkspace *) | Determine if the buffer needs to be initialised. |
IsEmissiveBufferInitialiseRequired(const DynamicMaterialWorkspace *) | Determine if the buffer needs to be initialised. |
IsTransparencyBufferInitialiseRequired(const DynamicMaterialWorkspace *) | Determine if the buffer needs to be initialised. |
All surfaces matching the specified instance. | |
The surface matching the instanceId, meshIndex and materialId combination. | |
All surfaces in the system. | |
Set the colour of a material selection within the DynamicMaterialWorkspace. | |
Set the emissive colour of a material selection within the DynamicMaterialWorkspace. | |
Set the transparency of a material selection within the DynamicMaterialWorkspace. | |
Update an AlbedoBuffer from the DynamicMaterialWorkspace. | |
Update an EmissiveBuffer from the DynamicMaterialWorkspace. | |
Update a TransparencyBuffer from the DynamicMaterialWorkspace. |
Geo::u32 GEO_CALL Enlighten::CalcAlbedoBufferSize
public: Geo::u32GEO_CALL CalcAlbedoBufferSize
(
const Enlighten::InputWorkspace * inputWorkspace
)
Calculate the size of the AlbedoBuffer for a system.
Parameters
[in] | inputWorkspace | A valid InputWorkspace for a system |
Returns
The size in bytes of the AlbedoBuffer. Return 0xFFFFFFFF if an error occurred.
Geo::u32 GEO_CALL Enlighten::CalcDynamicMaterialWorkspaceSize
public: Geo::u32GEO_CALL CalcDynamicMaterialWorkspaceSize
(
const ClusterAlbedoWorkspaceMaterialData * materialData
)
Calculate the size of the DynamicMaterialWorkspace.
Parameters
[in] | materialData | Pointer to the precompute material data. |
Returns
The size of the DynamicMaterialWorkspace in bytes. Returns 0xFFFFFFFF if an error occurred.
Geo::u32 GEO_CALL Enlighten::CalcEmissiveBufferSize
public: Geo::u32GEO_CALL CalcEmissiveBufferSize
(
const Enlighten::InputWorkspace * inputWorkspace
)
Calculate the size of the EmissiveBuffer for a system.
Parameters
[in] | inputWorkspace | A valid InputWorkspace for a system |
Returns
The size in bytes of the EmissiveBuffer. Return 0xFFFFFFFF if an error occurred.
Geo::u32 GEO_CALL Enlighten::CalcTransparencyBufferSize
public: Geo::u32GEO_CALL CalcTransparencyBufferSize
(
const Enlighten::InputWorkspace * inputWorkspace
)
Calculate the size of the TransparencyBuffer for a system.
Parameters
[in] | inputWorkspace | A valid InputWorkspace for a system |
Returns
The size in bytes of the TransparencyBuffer. Return 0xFFFFFFFF if an error occurred.
Enlighten::AlbedoBuffer* GEO_CALL Enlighten::CreateAlbedoBuffer
public: Enlighten::AlbedoBuffer *GEO_CALL CreateAlbedoBuffer
(
const Enlighten::InputWorkspace * inputWorkspace,
void * mem
)
Create an AlbedoBuffer for a system.
This AlbedoBuffer is used as input to the IndirectInputLightingStage.
Parameters
[in] | inputWorkspace | A valid InputWorkspace for a system |
[in] | mem | A pointer to 16 byte aligned memory of size returned by CalcAlbedoBufferSize() |
Returns
The complete and valid AlbedoBuffer object. Returns NULL if an error occurred.
Geo::u64 Enlighten::CreateCompositeMaterialId
public: Geo::u64 CreateCompositeMaterialId
(
Geo::u16 instanceId,
Geo::u16 meshIdx,
Geo::u32 baseMaterialId
)
Determine the specific material ID for a given instance, mesh and 32-bit material ID.
See the Material IDs & GUIDs page in the User Guide for further details.
DynamicMaterialWorkspace* GEO_CALL Enlighten::CreateDynamicMaterialWorkspace
public: DynamicMaterialWorkspace *GEO_CALL CreateDynamicMaterialWorkspace
(
const ClusterAlbedoWorkspaceMaterialData * materialData,
void * mem
)
Create a DynamicMaterialWorkspace which is used for dynamic updates of material colours at runtime.
Each system with dynamic materials will require one of these objects.
Parameters
[in] | materialData | A pointer to the precompute material data. |
[in] | mem | A pointer to the memory where the DynamicAlbedoWorkspace will be constructed. This block of memory must be at least CalcDynamicMaterialWorkspaceSize() bytes. |
Returns
A valid DynamicMaterialWorkspace object. Returns NULL if an error occurred.
Enlighten::EmissiveBuffer* GEO_CALL Enlighten::CreateEmissiveBuffer
public: Enlighten::EmissiveBuffer *GEO_CALL CreateEmissiveBuffer
(
const Enlighten::InputWorkspace * inputWorkspace,
void * mem
)
Create an EmissiveBuffer for a system.
This EmissiveBuffer is used as input to the IndirectInputLightingStage.
Parameters
[in] | inputWorkspace | A valid InputWorkspace for a system |
[in] | mem | A pointer to 16 byte aligned memory of size returned by CalcEmissiveBufferSize() |
Returns
The complete and valid EmissiveBuffer object. Returns NULL if an error occurred.
Enlighten::TransparencyBuffer* GEO_CALL Enlighten::CreateTransparencyBuffer
public: Enlighten::TransparencyBuffer *GEO_CALL CreateTransparencyBuffer
(
const Enlighten::InputWorkspace * inputWorkspace,
void * mem
)
Create a TransparencyBuffer for a system.
This TransparencyBuffer is used as input to the IndirectInputLightingStage.
Parameters
[in] | inputWorkspace | A valid InputWorkspace for a system |
[in] | mem | A pointer to 16 byte aligned memory of size returned by CalcTransparencyBufferSize() |
Returns
The complete and valid TransparencyBuffer object. Returns NULL if an error occurred.
CpuTextureElement GEO_CALL Enlighten::EncodeRGBM
public: CpuTextureElement GEO_CALL EncodeRGBM
(
float * rgb,
float MaxRange
)
Utility function for converting floating point values to the RGBM format.
Geo::u32 GEO_CALL Enlighten::GetClusterAlbedoWorkspaceMaterialDataSize
public: Geo::u32GEO_CALL GetClusterAlbedoWorkspaceMaterialDataSize
(
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData
)
Returns the size of the specified ClusterAlbedoWorkspaceMaterialData object.
Note that this includes the size of the two child RadDataBlocks.
Returns
Memory used in bytes, 0xFFFFFFFF upon error.
const Geo::u64* GEO_CALL Enlighten::GetClusterAlbedoWorkspaceMaterialIds
public: const Geo::u64 *GEO_CALL GetClusterAlbedoWorkspaceMaterialIds
(
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData
)
Returns a list of all material Ids referenced by this albedo workspace.
The length of the returned array can be found using GetClusterAlbedoWorkspaceNumMaterials().
Parameters
[in] | materialData | The albedo workspace material data to query. |
Geo::s32 GEO_CALL Enlighten::GetClusterAlbedoWorkspaceNumMaterials
public: Geo::s32GEO_CALL GetClusterAlbedoWorkspaceNumMaterials
(
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData
)
Returns the number of material Ids referenced by this albedo workspace.
Parameters
[in] | materialData | The albedo workspace material data to query. |
Returns
The number of materials referenced, -1 upon error.
bool GEO_CALL Enlighten::GetDebugAlbedoValue
public: bool GEO_CALL GetDebugAlbedoValue
(
const Geo::u32 debugClusterIdx, const AlbedoBuffer * albedoBuffer, Geo::v128 & outValue)