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 |
---|---|
Enlighten::ClusterAlbedoWorkspaceMaterialData | Constitutes the precomputed material data for a system. |
Enlighten::SurfaceColourDynamicity | A set of initialisers for the dynamicity of surface colours. |
Enlighten::TextureResolutionScale | 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
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
)
Get the cluster albedo value of a debug point from an AlbedoBuffer.
Parameters
[in] | debugClusterIdx | Index of the cluster |
[in] | albedoBuffer | The input AlbedoBuffer to query. |
[out] | outValue | The value in the buffer for the given debug point. returns true on success or false if an error occured. |
bool GEO_CALL Enlighten::GetDebugEmissiveValue
public: bool GEO_CALL GetDebugEmissiveValue
(
const Geo::u32 debugClusterIdx,
const EmissiveBuffer * emissiveBuffer,
Geo::v128 & outValue
)
Get the cluster emissive value of a debug point from an EmissiveBuffer.
Parameters
[in] | debugClusterIdx | Index of the cluster |
[in] | emissiveBuffer | The input EmissiveBuffer to query. |
[out] | outValue | The value in the buffer for the given debug point. returns true on success or false if an error occured. |
bool GEO_CALL Enlighten::GetDebugTransparencyValue
public: bool GEO_CALL GetDebugTransparencyValue
(
const Geo::u32 debugClusterIdx,
const TransparencyBuffer * transparencyBuffer,
float & outValue
)
Get the cluster transparency value of a debug point from an TransparencyBuffer.
Parameters
[in] | debugClusterIdx | Index of the cluster |
[in] | transparencyBuffer | The input TransparencyBuffer to query. |
[out] | outValue | The value in the buffer for the given debug point. returns true on success or false if an error occured. |
bool GEO_CALL Enlighten::GetTextureSize
public: bool GEO_CALL GetTextureSize
(
const Enlighten::RadSystemCore * radSystemCoreIn,
const TextureResolutionScale::Value scale,
Geo::s32 & widthOut,
Geo::s32 & heightOut
)
Returns the required dimensions of the albedo and emissive textures for a given radiosity core.
This is a replacement for GetTextureAlbedoSize()
Parameters
[in] | radSystemCoreIn | The radiosity core to compute the texture dimensions for. |
[in] | scale | The desired texture resolution scale. |
[out] | widthOut | The width of the albedo and emissive textures, -1 upon error. |
[out] | heightOut | The height of the albedo and emissive textures, -1 upon error. returns true on success or false if an error occurred. |
void Enlighten::GetTextureSize
public: void GetTextureSize
(
const TextureResolutionScale::Value scale,
Geo::s32 widthIn,
Geo::s32 heightIn,
Geo::s32 & widthOut,
Geo::s32 & heightOut
)
Inline function that returns the required dimensions of the albedo and emissive textures for a given a texture width and height.
bool GEO_CALL Enlighten::InitialiseAlbedoBufferFromColoursPerPoint
public: bool GEO_CALL InitialiseAlbedoBufferFromColoursPerPoint
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const InputWorkspace * inputWorkspace,
const Geo::v128 * pointAlbedoColours,
const Geo::s32 numPoints,
AlbedoBuffer * albedoBuffer
)
Sets the albedo colours for an AlbedoBuffer based on the individual sample points.
You can use Enlighten::GetNumberOfPointsInInputWorkspace() to get the number of points in a system, and Enlighten::GetInputWorkspacePositionAndNormalArray() to get their positions and normals.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | inputWorkspace | The input workspace for the system. |
[in] | pointAlbedoColours | The albedo colours to set for the points. Each colour component should be between [0..1]. Values outside this range will be clamped internally. The size of this array must be equal to or larger than the value in numPoints. These values are expected in linear colour space. |
[in] | numPoints | Number of sample points provided. It must match the number of points in the input workspace. |
[in] | albedoBuffer | The AlbedoBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseAlbedoBufferFromMaterialWorkspace
public: bool GEO_CALL InitialiseAlbedoBufferFromMaterialWorkspace
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
AlbedoBuffer * albedoBuffer
)
Sets the albedo colours for an AlbedoBuffer from a materialWorkspace.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | albedoBuffer | The AlbedoBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseAlbedoBufferFromTexture
public: bool GEO_CALL InitialiseAlbedoBufferFromTexture
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const Enlighten::InputTextureSamplerParameters * textureParams,
const TextureResolutionScale::Value resolutionScale,
AlbedoBuffer * albedoBuffer
)
Sets the albedo colours for an AlbedoBuffer from an albedo texture expected in RGBA format in gamma-2 colour space.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | textureParams | Parameters used for sampling the albedo texture on the CPU. |
[in] | resolutionScale | An enumeration representing the size of the albedo texture relative to the lightmap resolution. Can be FullResolutionScale or HalfResolutionScale. |
[in] | albedoBuffer | The AlbedoBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseEmissiveBufferFromColoursPerPoint
public: bool GEO_CALL InitialiseEmissiveBufferFromColoursPerPoint
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const InputWorkspace * inputWorkspace,
const Geo::v128 * pointEmissiveColours,
const Geo::s32 numPoints,
EmissiveBuffer * emissiveBuffer
)
Sets the emissive colours for an EmissiveBuffer based on the individual sample points.
You can use Enlighten::GetNumberOfPointsInInputWorkspace() to get the number of points in a system, and Enlighten::GetInputWorkspacePositionAndNormalArray() to get their positions and normals.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | inputWorkspace | The input workspace for the system. |
[in] | pointEmissiveColours | The albedo colours to set for the points. Each colour component should be between [0..1]. Values outside this range will be clamped internally. The size of this array must be equal to or larger than the value in numPoints. These values are expected in linear colour space. |
[in] | numPoints | Number of sample points provided. It must match the number of points in the input workspace. |
[in] | emissiveBuffer | The EmissiveBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseEmissiveBufferFromMaterialWorkspace
public: bool GEO_CALL InitialiseEmissiveBufferFromMaterialWorkspace
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
EmissiveBuffer * emissiveBuffer
)
Sets the emissive colours for an EmissiveBuffer from a materialWorkspace.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | emissiveBuffer | The EmissiveBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseEmissiveBufferFromTexture
public: bool GEO_CALL InitialiseEmissiveBufferFromTexture
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const Enlighten::InputTextureSamplerParameters * textureParams,
float fixedPointMaximum,
const TextureResolutionScale::Value resolutionScale,
EmissiveBuffer * emissiveBuffer
)
Sets the emissive colours for an EmissiveBuffer from an emissive texture expected in RGBM format in linear colour space.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | textureParams | Parameters used for sampling the albedo texture on the CPU. |
[in] | fixedPointMaximum | The maximum value representable by the fixed point RGBM format. |
[in] | resolutionScale | An enumeration representing the size of the albedo texture relative to the lightmap resolution. Can be FullResolutionScale or HalfResolutionScale. |
[in] | emissiveBuffer | The EmissiveBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseEmissiveBufferFromTextureFp16
public: bool GEO_CALL InitialiseEmissiveBufferFromTextureFp16
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const Enlighten::InputTextureSamplerParameters * textureParams,
const TextureResolutionScale::Value resolutionScale,
EmissiveBuffer * emissiveBuffer
)
Sets the emissive colours for an EmissiveBuffer from an emissive texture expected in FP16 format in linear colour space.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | textureParams | Parameters used for sampling the albedo texture on the CPU. |
[in] | resolutionScale | An enumeration representing the size of the albedo texture relative to the lightmap resolution. Can be FullResolutionScale or HalfResolutionScale. |
[in] | emissiveBuffer | The EmissiveBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseInstanceEmissiveAsDynamic
public: bool GEO_CALL InitialiseInstanceEmissiveAsDynamic
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const Geo::u16 instanceId
)
Initialise all the materials of an instance in the DynamicMaterialWorkspace as dynamic.
This is used to distinguish dynamic material values from static values when initialising or reconstructing the EmissiveBuffer. If a material albedo component is not initialised as dynamic, any calls to SetMaterialEmissiveColour() will require the EmissiveBuffer to be re-initialised.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | instanceId | The instance ID to set the emissive for. |
Returns
True on success or false if an error occurred. This does not imply whether or not the instance was found.
bool GEO_CALL Enlighten::InitialiseMaterialDynamicity
public: bool GEO_CALL InitialiseMaterialDynamicity
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const SurfaceSelection & selection,
SurfaceColourDynamicity dynamicity
)
Initialise a material component in the DynamicMaterialWorkspace as static or dynamic.
This is used to distinguish dynamic material values from static values when initialising or reconstructing the AlbedoBuffer. If a material component is not initialised as dynamic albedo, any calls to SetMaterialAlbedoColour() will require the AlbedoBuffer to be re-initialised. If a material component is not initialised as dynamic emissive, any calls to SetMaterialEmissiveColour() will require the EmissiveBuffer to be re-initialised. If a material component is not initialised as dynamic transparency, any calls to SetMaterialTransparency() will require the TransparencyBuffer to be re-initialised.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | selection | The selection of surfaces to set the state for. |
[in] | dynamicity | The dynamicity to initialise the material component with. |
Returns
True on success or false if an error occurred. This does not imply whether or not the material was found.
bool GEO_CALL Enlighten::InitialiseMaterialEmissiveAsDynamic
public: bool GEO_CALL InitialiseMaterialEmissiveAsDynamic
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const Geo::u64 & materialId
)
Initialise a material emissive component in the DynamicMaterialWorkspace as dynamic.
This is used to distinguish dynamic material values from static values when initialising or reconstructing the EmissiveBuffer. If a material emissive component is not initialised as dynamic, any calls to SetMaterialEmissiveColour() will require the EmissiveBuffer to be re-initialised.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | materialId | The material 64 bit material ID to set the emissive for. |
Returns
True on success or false if an error occurred. This does not imply whether or not the material was found.
bool GEO_CALL Enlighten::InitialiseSystemEmissiveAsDynamic
public: bool GEO_CALL InitialiseSystemEmissiveAsDynamic
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData
)
Initialise all the materials in the DynamicMaterialWorkspace as dynamic.
This is used to distinguish dynamic material values from static values when initialising or reconstructing the EmissiveBuffer. If a material albedo component is not initialised as dynamic, any calls to SetMaterialEmissiveColour() will require the EmissiveBuffer to be re-initialised.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseTransparencyBufferFromColoursPerPoint
public: bool GEO_CALL InitialiseTransparencyBufferFromColoursPerPoint
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const InputWorkspace * inputWorkspace,
const float * pointTransparencyValues,
const Geo::s32 numPoints,
TransparencyBuffer * transparencyBuffer
)
Sets the transparency for a TransparencyBuffer based on the individual sample points.
You can use Enlighten::GetNumberOfPointsInInputWorkspace() to get the number of points in a system, and Enlighten::GetInputWorkspacePositionAndNormalArray() to get their positions and normals.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | inputWorkspace | The input workspace for the system. |
[in] | pointTransparencyValues | The transparency values to set for the points. Each value should be between [0..1]. Values outside this range will be clamped internally. The size of this array must be equal to or larger than the value in numPoints. These values are expected in linear colour space. |
[in] | numPoints | Number of sample points provided. It must match the number of pointsg in the input workspace. |
[in] | transparencyBuffer | The TransparencyBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseTransparencyBufferFromMaterialWorkspace
public: bool GEO_CALL InitialiseTransparencyBufferFromMaterialWorkspace
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
TransparencyBuffer * transparencyBuffer
)
Sets the values for a TransparencyBuffer from a materialWorkspace.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | transparencyBuffer | The TransparencyBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::InitialiseTransparencyBufferFromTexture
public: bool GEO_CALL InitialiseTransparencyBufferFromTexture
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const Enlighten::InputTextureSamplerParameters * textureParams,
const Geo::s32 pixelStrideInBytes,
const Geo::s32 alphaOffsetInBytes,
const TextureResolutionScale::Value resolutionScale,
TransparencyBuffer * transparencyBuffer
)
Sets the values for a TransparencyBuffer from a the alpha channel in the albedo texture in RGBA format.
In the alpha channel 0 represents fully transparent and 255 represents fully opaque in linear space.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | textureParams | Parameters used for sampling the albedo texture on the CPU. |
[in] | pixelStrideInBytes | The stride between pixels in the texture. |
[in] | alphaOffsetInBytes | The byte offset to the first alpha element. |
[in] | resolutionScale | An enumeration representing the size of the albedo texture relative to the lightmap resolution. Can be FullResolutionScale or HalfResolutionScale. |
[in] | transparencyBuffer | The TransparencyBuffer which is being initialised. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::IsAlbedoBufferInitialiseRequired
public: bool GEO_CALL IsAlbedoBufferInitialiseRequired
(
const DynamicMaterialWorkspace * materialWorkspace
)
Determine if the buffer needs to be initialised.
An initialised buffer can require re-initialisation if a static colour changes or the dynamic-ness of a material changes.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
Returns
True if the buffer needs to be initialised.
bool GEO_CALL Enlighten::IsEmissiveBufferInitialiseRequired
public: bool GEO_CALL IsEmissiveBufferInitialiseRequired
(
const DynamicMaterialWorkspace * materialWorkspace
)
Determine if the buffer needs to be initialised.
An initialised buffer can require re-initialisation if a static colour changes or the dynamic-ness of a material changes.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
Returns
True if the buffer needs to be initialised.
bool GEO_CALL Enlighten::IsTransparencyBufferInitialiseRequired
public: bool GEO_CALL IsTransparencyBufferInitialiseRequired
(
const DynamicMaterialWorkspace * materialWorkspace
)
Determine if the buffer needs to be initialised.
An initialised buffer can require re-initialisation if a static colour changes or the dynamic-ness of a material changes.
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
Returns
True if the buffer needs to be initialised.
SurfaceSelection Enlighten::MakeInstanceSurfaceSelection
public: SurfaceSelection MakeInstanceSurfaceSelection
(
Geo::u16 instanceId
)
All surfaces matching the specified instance.
SurfaceSelection Enlighten::MakeSingleSurfaceSelection
public: SurfaceSelection MakeSingleSurfaceSelection
(
Geo::u16 instanceId,
Geo::u16 meshIndex,
Geo::u32 materialId
)
The surface matching the instanceId, meshIndex and materialId combination.
SurfaceSelection Enlighten::MakeSystemSurfaceSelection
public: SurfaceSelection MakeSystemSurfaceSelection()
All surfaces in the system.
bool GEO_CALL Enlighten::SetMaterialAlbedoColour
public: bool GEO_CALL SetMaterialAlbedoColour
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const SurfaceSelection & selection,
const Geo::v128 & newAlbedoColour
)
Set the colour of a material selection within the DynamicMaterialWorkspace.
If the selection has been previously setup as dynamic (using InitialiseMaterialAlbedoAsDynamic()), the AlbedoBuffer will need updating using UpdateAlbedoBuffer(). If the selection is static however, the AlbedoBuffer will need re-initialising using InitialiseAlbedoBufferFromMaterialWorkspace().
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | selection | The selection of surfaces to set the albedo for. |
[in] | newAlbedoColour | The colour to set the material to. This is expected to be in linear colour space. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::SetMaterialEmissiveColour
public: bool GEO_CALL SetMaterialEmissiveColour
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const SurfaceSelection & selection,
const Geo::v128 & newEmissiveColour
)
Set the emissive colour of a material selection within the DynamicMaterialWorkspace.
If the selection has been previously setup as dynamic (using InitialiseMaterialEmissiveAsDynamic()), the EmissiveBuffer will need updating using UpdateEmissiveBuffer(). If the selection is static however, the EmissiveBuffer will need re-initialising using InitialiseEmissiveBufferFromMaterialWorkspace().
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | selection | The selection of surfaces to set the emissive for. |
[in] | newEmissiveColour | The colour to set to the emissive component of the material. This is expected to be in linear colour space. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::SetMaterialTransparency
public: bool GEO_CALL SetMaterialTransparency
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
const SurfaceSelection & selection,
float newTransparency
)
Set the transparency of a material selection within the DynamicMaterialWorkspace.
If the selection has been previously setup as dynamic (using InitialiseMaterialTransparencyAsDynamic()), the TransparencyBuffer will need updating using UpdateTransparencyBuffer(). If the selection is static however, the TransparencyBuffer will need re-initialising using InitialiseTransparencyBufferFromMaterialWorkspace().
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | selection | The selection of surfaces to set the transparency for. |
[in] | newTransparency | The transparency to set the material to. This is expected to be in linear space. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::UpdateAlbedoBuffer
public: bool GEO_CALL UpdateAlbedoBuffer
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
Enlighten::AlbedoBuffer * albedoBuffer
)
Update an AlbedoBuffer from the DynamicMaterialWorkspace.
This will preserve values that were initialised with static data (ie ColourPerPoint or Texture).
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | albedoBuffer | A valid AlbedoBuffer where the results will be written to. This buffer is used as input to the IndirectInputLighting stage. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::UpdateEmissiveBuffer
public: bool GEO_CALL UpdateEmissiveBuffer
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
Enlighten::EmissiveBuffer * emissiveBuffer
)
Update an EmissiveBuffer from the DynamicMaterialWorkspace.
This will preserve values that were initialised with static data (ie ColourPerPoint or Texture).
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | emissiveBuffer | A valid EmissiveBuffer where the results will be written to. This buffer is used as input to the IndirectInputLighting stage. |
Returns
True on success or false if an error occurred.
bool GEO_CALL Enlighten::UpdateTransparencyBuffer
public: bool GEO_CALL UpdateTransparencyBuffer
(
DynamicMaterialWorkspace * materialWorkspace,
const Enlighten::ClusterAlbedoWorkspaceMaterialData * materialData,
Enlighten::TransparencyBuffer * transparencyBuffer
)
Update a TransparencyBuffer from the DynamicMaterialWorkspace.
This will preserve values that were initialised with static data (ie ColourPerPoint or Texture).
Parameters
[in] | materialWorkspace | A pointer to the DynamicMaterialWorkspace for the system. |
[in] | materialData | A pointer to the precompute material data. |
[in] | transparencyBuffer | A valid TransparencyBuffer where the results will be written to. This buffer is used as input to the IndirectInputLighting stage. |
Returns
True on success or false if an error occurred.