Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Enlighten::ProbeSetManagerVoxel

    └>Enlighten::IProbeSetManager

Probe Set Manager Voxel class Implementation of the IProbeSetManager interface class This implementation is based on a voxel grid acceleration data structure.

The scene is being voxelised, for each voxel we store an array of probe sets that intersect that voxel. Then at run time for a given point we can retrieve the voxel this point is in, and therefore all the probe sets that may be needed for interpolation.

To assign probe sets to voxels we do not need any run time data for the probe sets. Only their geometrical properties are needed (bounding box, resolution). At run time ProbeSetManagerVoxel keeps track (via MarkProbeSetAsLoaded and MarkProbeSetAsUnLoaded methods) of which probe sets have their run time data loaded, and uses only those ones for interpolation.

During interpolation each probe sets gets a weight (based on where it is in relation to the query point), that maximum weight that a given probe set can get is limited by the MaxWeight that can be set using SetMaxWeightForProbeSet method. This mechanism allows for LOD switching (given probe set can has its maximum weight gradually decreased to 0 and when it reaches 0 it can be unloaded and a different LOD probe set loaded)

Classes

NameDescription
Enlighten::ProbeSetManagerVoxel::ProbeSetIndicesComparitor

a utility struct to be used with std::sort, order based on probes density

Enlighten::ProbeSetManagerVoxel::ProbeSetProps

Helper struct describing a probe set properties.

Enlighten::ProbeSetManagerVoxel::Voxel

Helper struct describing a voxel.

Variables

NameDescription
void * m_InternalMemory

internal memory used by the class - needs to be provided by the user. Has to be at least 4-bytes aligned.

bool m_IsInitialised

is the manager in an initialised state

float m_MaxVolumeForVoxelisationInVoxelVolumes

if a volume of given probe set divided by the voxel volume is greater than this threshold, then that probe set will not be voxelised

Geo::u16 * m_NotVoxelisedProbeSetPropsIndices

pointer to an array that holds indices to (m_ProbeSetProps) of ProbeSets that were too big to be voxelised

Geo::u16 m_NumNotVoxalisedProbeSets

number of not voxelised Probe Sets

Geo::u16 m_NumProbeSets

total number of Probe Sets under management (both voxelised and not)

ProbeSetProps * m_ProbeSetProps

pointer to an array of ProbeSetProps objects, after Initialise() this is sorted by the Guids of the ProbeSets Indices in Voxel::m_ProbeSetPropsIndices are indices into this array.

size_t m_SizeOfInternalMemory

size of the external memory provided by the user.

Geo::u32 m_TotalNumOfOccupiedVoxels

Number of occupied voxels.

Voxel * m_Voxels

pointer to an array that holds all the voxels (sorted by their coordinates)

Geo::v128 m_VoxelSize

Voxel size.

Functions

NameDescription
CalculateInternalMemoryRequirement(Geo::v128, float, RadProbeSetMetaData const *const *, Geo::u16)

Method to calculate the upper limit on memory needed by the Probe Set Manager.

ConstructExpandedNonAABBVolume(Enlighten::RadProbeSetMetaData const &)

Return an expanded bounding volume constructed from given meta data.

FindIndexIntoProbeSetPropsArray(Geo::GeoGuid, Geo::u16 &)

For a given Probe Set guid, find an index into m_ProbeSetProps array.

GetInternalMemory()

Get the internal memory storage.

GetInterpolationInputSet(Geo::u32)

Get an interpolation set that corresponds to given index.

GetInterpolationInputSet(Geo::GeoGuid)

Get an interpolation set that corresponds to given guid.

GetInterpolationInputSet(Geo::u32)

Get an interpolation set that corresponds to given index - this index needs to be comaptible with ProbeInterpolant::m_ProbeSetIndex filled by the GetProbeInterpolants(...) method.

GetLodRangeProbeInterpolants(Geo::v128 const &, ProbeInterpolant *, Geo::s32, Geo::u8 *, Geo::u32)

Retrieves the probes interpolants for a given point and specified range of LODs.

GetMaxWeightForProbeSet(Geo::GeoGuid const &, float &)

Set a maximum interpolation weight for the given Probe Set.

GetMaxWeightForProbeSet(Geo::GeoGuid const &, float &)

Get the maximum weight for a given Probe Set.

GetNotVoxelisedProbeSetProps(Geo::s32)

Get the ProbeSetProps for a given not voxelised Probe Set.

GetNumNotVoxelisedProbeSets()

Some of the Probe Sets may be too big to undergo full voxelisation (i.e.

GetNumProbeSets()

Get the total number of Probe Sets under management.

GetNumProbeSets()

Return the total (both voxelised and not voxelised) probe sets that are under management.

GetNumVoxels()

Get the total number of occupied voxels.

GetProbeInterpolants(Geo::v128 const &, ProbeInterpolant *, Geo::s32, Geo::s32 &)

Retrieves the probes interpolants for a given point.

GetProbeInterpolants(Geo::v128 const &, ProbeInterpolant *, Geo::s32, Geo::s32 &, Geo::u32)

Retrieves the probes interpolants for a given point and specified LOD.

GetProbeInterpolants(Geo::v128 const &, ProbeInterpolant *, Geo::s32, Geo::s32 &, Geo::u32)

Retrieves the probes interpolants for a given point and specified LOD.

GetProbeInterpolants(Geo::v128 const &, ProbeInterpolant *, Geo::s32, Geo::s32 &)

Retrieves the probes interpolants for a given point.

GetProbeSetInterpolants(const Geo::v128 &, const Geo::u16 *, Geo::u16, ProbeInterpolant *, Geo::GeoPair< Geo::s32, bool > *, Geo::s32, Geo::s32 &)

Return Probe Set Interpolators.

GetProbeSetProps(Geo::s32)

Get the ProbeSetProps for a given index.

GetVoxel(Geo::u32)

Get the voxel for a given index.

GetVoxelSize()

Get voxel size used by the Probe Set Manager.

Initialise(Geo::v128, float, RadProbeSetMetaData const *const *, Geo::u16, size_t &)

Initialise the class, construct the internal acceleration data structure.

IsIndex1DensitySmallerThanIndex2Density(Geo::u16, Geo::u16)

Return true if Probe Set at index1 has smaller probe density than the one at index2.

IsInitialised()

Return an true if manager was successfully initialised.

MarkAllProbeSetsAsUnloaded()

Mark all Interpolation Set as unloaded.

MarkAllProbeSetsAsUnloaded()

Marks all Interpolation Input Sets as unloaded.

MarkProbeSetAsLoaded(Enlighten::InterpolationInputSet const &)

Marks given Interpolation Input Set as loaded.

MarkProbeSetAsLoaded(Enlighten::InterpolationInputSet const &)

Mark given Interpolation Set as loaded, and provide run time data for it.

MarkProbeSetAsUnloaded(Geo::GeoGuid const &)

Mark given Interpolation Set as unloaded.

MarkProbeSetAsUnloaded(Geo::GeoGuid const &)

Marks given Interpolation Input Set as unloaded.

OnAllLoadedProbeSetsArrayChanged(Enlighten::InterpolationInputSet const *, Geo::s32)

Allows the probe set manager a chance to observe the contiguous memory block in which the runtime stores all loaded input sets.

SetInternalMemory(void *, size_t)

Set the internal memory storage to an externally allocated mem pool.

SetMaxWeightForProbeSet(Geo::GeoGuid const &, float)

Set the maximum weight for a given Probe Set.

SetMaxWeightForProbeSet(Geo::GeoGuid const &, float)

Set a maximum interpolation weight for the given Probe Set.

ShouldNotVoxeliseVolume(float)

Return true if given volume is too big to be voxelised.


Anchor
a7b75e9c7fa82cf81f421bd1e25fd4928
a7b75e9c7fa82cf81f421bd1e25fd4928

std::size_t Enlighten::ProbeSetManagerVoxel::CalculateInternalMemoryRequirement

...

public: std::size_t CalculateInternalMemoryRequirement
(
    Geo::v128 voxelSize,
    float maxVolumeThreshold,
    RadProbeSetMetaData const *const * probeSets,
    Geo::u16 numProbeSets
)

...

Method to calculate the upper limit on memory needed by the Probe Set Manager.

Parameters
[in]voxelSize

The size of the voxel (the smaller the voxel to more memory will be needed)

[in]maxVolumeThreshold

Maximum ratio of probe set volume to voxel volume for a probe set to be voxelised.

[in]probeSets

Array of geometrical descriptions of all the probe sets that will be under the management.

[in]numProbeSets

Number of entries in probeSets array.

Returns

The upper limit on memory needed to initialise the Probe Set Manager.


Anchor
a6483cc09b4034f9a49551dd0d1924eee
a6483cc09b4034f9a49551dd0d1924eee

Geo::GeoNonAABoundingBox Enlighten::ProbeSetManagerVoxel::ConstructExpandedNonAABBVolume

...

public: Geo::GeoNonAABoundingBox ConstructExpandedNonAABBVolume
(
    Enlighten::RadProbeSetMetaData const & volumeMetaData
) const

...

Return an expanded bounding volume constructed from given meta data.

Returns

expanded bounding volume of the probe set


Anchor
a42f9f6dd2e6c1855405f59041c58df82
a42f9f6dd2e6c1855405f59041c58df82

bool Enlighten::ProbeSetManagerVoxel::FindIndexIntoProbeSetPropsArray

...

protected: bool FindIndexIntoProbeSetPropsArray
(
    Geo::GeoGuid guid,
    Geo::u16 & index
) const

...

For a given Probe Set guid, find an index into m_ProbeSetProps array.

Since m_ProbeSetProbs is sorted by the Probe Set guids, so this is a OLog(n) operation.

Parameters
[in]guid

Guid of the Probe Set.

[out]index

Index of that Probe Set into the m_ProbeSetProps array.

Returns

TRUE if the Probe Set Manager is initialised and the Probe Set with guid is under its management, FALSE otherwise.


Anchor
aa4276178dbf387faf54a16ad285e67fa
aa4276178dbf387faf54a16ad285e67fa

void* Enlighten::ProbeSetManagerVoxel::GetInternalMemory

...

public: void * GetInternalMemory() const

...

Get the internal memory storage.

Returns

the internal memory storage.


Anchor
ac433112549a1e388ac4d426324cffb41
ac433112549a1e388ac4d426324cffb41

virtual Enlighten::InterpolationInputSet const* Enlighten::ProbeSetManagerVoxel::GetInterpolationInputSet

...

public: virtual Enlighten::InterpolationInputSet const * GetInterpolationInputSet
(
    Geo::u32 index
) const

...

Get an interpolation set that corresponds to given index.

This index is comaptible with ProbeInterpolant::m_ProbeSetIndex

Returns

InterpolationInputSet that corresponds to the given index. Can be NULL if the probe set for that index is not loaded. Note that none of the probe set indices returned from GetProbeInterpolants will correspond to unloaded probe sets.


Anchor
a578b11a6a36866e8525a7d75f6bc277d
a578b11a6a36866e8525a7d75f6bc277d

Enlighten::InterpolationInputSet const* Enlighten::ProbeSetManagerVoxel::GetInterpolationInputSet

...

public: Enlighten::InterpolationInputSet const * GetInterpolationInputSet
(
    Geo::GeoGuid guid
) const

...

Get an interpolation set that corresponds to given guid.

Needs to perform a search. Scales as Log(N) [N - num of probe sets)

Returns

InterpolationInputSet that corresponds to the given guid. Can be NULL if the probe set for that guid is not loaded.


Anchor
a9e37c7ce2a6fc7719ea7ddcc9bd7177b
a9e37c7ce2a6fc7719ea7ddcc9bd7177b

virtual Enlighten::InterpolationInputSet const* Enlighten::IProbeSetManager::GetInterpolationInputSet

...

public: Enlighten::InterpolationInputSet const * GetInterpolationInputSet
(
    Geo::u32 index
) const

...

Get an interpolation set that corresponds to given index - this index needs to be comaptible with ProbeInterpolant::m_ProbeSetIndex filled by the GetProbeInterpolants(...) method.

May return NULL is Probe Set that corresponds to index is unloaded. Note, however that none of the ProbeInterpolant::m_ProbeSetIndex indices returned from GetProbeInterpolants(...) should correspond to an unloaded Probe Sets.

Returns

The InterpolationI Input Set for a given index or NULL if that Probe Set in unloaded.


Anchor
ae01c5ba094b110f75dcd1270868eee5a
ae01c5ba094b110f75dcd1270868eee5a

virtual bool Enlighten::IProbeSetManager::GetLodRangeProbeInterpolants

...

public: virtual bool GetLodRangeProbeInterpolants
(
    Geo::v128 const & point,
    ProbeInterpolant * interpolants,
    Geo::s32 numMaxInterpolants,
    Geo::u8 * numUsedInterpolants,
    Geo::u32 numLods
) const

...

Retrieves the probes interpolants for a given point and specified range of LODs.

Only loaded Probe Sets are considered for interpolation. This interface is only supported to enable Transparency and Contributing Probe when using Probe LOD with PPPI.

Parameters
[in]point

Location used for the interpolation.

[out]interpolants

Output probe interpolants array with size numMaxInterpolants * numLods.

[in]numMaxInterpolants

Maximum number of interpolants that may be output for each LOD.

[out]numUsedInterpolants

Array to which is output the number of interpolants used for each LOD.

[in]numLods

The range of LODs [0, numLods) for which interpolants should be returned.

Returns

TRUE if the input to this function is valid and the interpolation is successful, otherwise FALSE.


Anchor
a6ed451fc819605dd5a437b3154c7624f
a6ed451fc819605dd5a437b3154c7624f

virtual bool Enlighten::IProbeSetManager::GetMaxWeightForProbeSet

...

public: bool GetMaxWeightForProbeSet
(
    Geo::GeoGuid const & probeSet,
    float & maxWeight
) const

...

Set a maximum interpolation weight for the given Probe Set.

. Needs to perform a search OLog(N). Where N is number of probe sets under management.

Parameters
[in]probeSet

The GUID of the Probe Set.

[out]maxWeight

New maximum interpolation weight.

Returns

TRUE if the Probe Set is under ProbeSetManager management, otherwise FALSE.


Anchor
abba3a88f3aad93f69f4c05036bca79be
abba3a88f3aad93f69f4c05036bca79be

virtual bool Enlighten::ProbeSetManagerVoxel::GetMaxWeightForProbeSet

...

public: virtual bool GetMaxWeightForProbeSet
(
    Geo::GeoGuid const & probeSet,
    float & maxWeight
) const

...

Get the maximum weight for a given Probe Set.

Parameters
[in]probeSet

GUID of the Probe Set to retrieve the maximum weight for.

[out]maxWeight

The retrieved maximum weight.

Returns

TRUE if the input to this function is valid, Probe Set Manager is initialised and the probeSet probe set is under Probe Set Manager management, otherwise FALSE.


Anchor
a8cc00350fa47192f1fc92fc50672ffb2
a8cc00350fa47192f1fc92fc50672ffb2

ProbeSetProps const& Enlighten::ProbeSetManagerVoxel::GetNotVoxelisedProbeSetProps

...

public: ProbeSetProps const & GetNotVoxelisedProbeSetProps
(
    Geo::s32 index
) const

...

Get the ProbeSetProps for a given not voxelised Probe Set.

The index used here is an index to m_NotVoxelisedProbeSetPropsIndices array which in turn holds indices to m_ProbeSetProps. This index is NOT compatible with what is being returned from GetProbeInterpolants in ProbeInterpolant::m_ProbeSetIndex.

Returns

ProbeSetProps for the requested not voxelised Probe Set index.


Anchor
ad147016586399a2a961460bdacad0471
ad147016586399a2a961460bdacad0471

Geo::u16 Enlighten::ProbeSetManagerVoxel::GetNumNotVoxelisedProbeSets

...

public: Geo::u16 GetNumNotVoxelisedProbeSets() const

...

Some of the Probe Sets may be too big to undergo full voxelisation (i.e.

voxelising them would produce too many voxels. Those probe sets are stored in an additional array. This method returns the number of those not voxelised volumes. If for a given point in space no voxel in the m_Voxels can be found, then not voxelised probe sets should be used for interpolation. If however a voxel is found, then there is no need to check the not voxelised sets as the Voxel::m_ProbeSetPropsIndices contains not voxelised volumes too.

Returns

Number of not voxelised Probe Sets.


Anchor
a9c30b77918c361c9ca11d1cffdda2054
a9c30b77918c361c9ca11d1cffdda2054

virtual Geo::s32 Enlighten::IProbeSetManager::GetNumProbeSets

...

public: Geo::s32 GetNumProbeSets() const

...

Get the total number of Probe Sets under management.

Returns

the total number of Probe Sets under management.


Anchor
af4ac68323cbfb73afbbbcb93ab7f47b9
af4ac68323cbfb73afbbbcb93ab7f47b9

virtual Geo::s32 Enlighten::ProbeSetManagerVoxel::GetNumProbeSets

...

public: virtual Geo::s32 GetNumProbeSets() const

...

Return the total (both voxelised and not voxelised) probe sets that are under management.

Returns

total number of probe sets under management.


Anchor
a55a292ccf0a2df0ac4e5abaaf9f49103
a55a292ccf0a2df0ac4e5abaaf9f49103

Geo::s32 Enlighten::ProbeSetManagerVoxel::GetNumVoxels

...

public: Geo::s32 GetNumVoxels() const

...

Get the total number of occupied voxels.

Returns

Number of occupied voxels.


Anchor
a6ea3968ed2380441994e35535faff8df
a6ea3968ed2380441994e35535faff8df

virtual bool Enlighten::ProbeSetManagerVoxel::GetProbeInterpolants

...

public: virtual bool GetProbeInterpolants
(
    Geo::v128 const & point,
    ProbeInterpolant * interpolants,
    Geo::s32 numMaxInterpolants,
    Geo::s32 & numUsedInterpolants
) const

...

Retrieves the probes interpolants for a given point.

Parameters
[in]point

Location used for the interpolation.

[out]interpolants

Output probe interpolants.

[in]numMaxInterpolants

Size of the output interpolants array.

[out]numUsedInterpolants

Number of interpolants actually used.

Returns

TRUE if the input to this function is valid, Probe Set Manager is initialised and the interpolation is successful (including the case where the point is outside all voxels, in which case numUsedInterpolants will be set to zero), otherwise FALSE.


Anchor
a4c41b5a6573ed220c7a6b0f72b7d6462
a4c41b5a6573ed220c7a6b0f72b7d6462

virtual bool Enlighten::ProbeSetManagerVoxel::GetProbeInterpolants

...

public: virtual bool GetProbeInterpolants
(
    Geo::v128 const & point,
    ProbeInterpolant * interpolants,
    Geo::s32 numMaxInterpolants,
    Geo::s32 & numUsedInterpolants,
    Geo::u32 lod
) const

...

Retrieves the probes interpolants for a given point and specified LOD.

Only loaded Probe Sets are considered for interpolation. Note: This method will produce incorrect results because the ProbeSetManagerVoxel ProbeSetManager does not support LOD. Implicitly uses calls method above and issues a warning.

Parameters
[in]point

Location used for the interpolation.

[out]interpolants

Output probe interpolants.

[in]numMaxInterpolants

Size of the output interpolants array.

[out]numUsedInterpolants

Number of interpolants actually used.

[in]lod

This parameter is ignored since this ProbeSetManager does not support probe LOD.

Returns

TRUE if the input to this function is valid and the interpolation is successful, otherwise FALSE.


Anchor
a601d24a59202f09f6b9f1c541da7de74
a601d24a59202f09f6b9f1c541da7de74

virtual bool Enlighten::IProbeSetManager::GetProbeInterpolants

...

public: bool GetProbeInterpolants
(
    Geo::v128 const & point,
    ProbeInterpolant * interpolants,
    Geo::s32 numMaxInterpolants,
    Geo::s32 & numUsedInterpolants,
    Geo::u32 lod
) const

...

Retrieves the probes interpolants for a given point and specified LOD.

Only loaded Probe Sets are considered for interpolation. This interface is only supported to enable Transparency and Contributing Probe when using Probe LOD with PPPI.

Parameters
[in]point

Location used for the interpolation.

[out]interpolants

Output probe interpolants.

[in]numMaxInterpolants

Size of the output interpolants array.

[out]numUsedInterpolants

Number of interpolants actually used.

[in]lod

The LOD to select which interpolants should be returned.

Returns

TRUE if the input to this function is valid and the interpolation is successful, otherwise FALSE.


Anchor
a25f31ccd7c2cae8abf47d31e6af1c7af
a25f31ccd7c2cae8abf47d31e6af1c7af

virtual bool Enlighten::IProbeSetManager::GetProbeInterpolants

...

public: bool GetProbeInterpolants
(
    Geo::v128 const & point,
    ProbeInterpolant * interpolants,
    Geo::s32 numMaxInterpolants,
    Geo::s32 & numUsedInterpolants
) const

...

Retrieves the probes interpolants for a given point.

Only loaded Probe Sets are considered for interpolation.

Parameters
[in]point

Location used for the interpolation.

[out]interpolants

Output probe interpolants.

[in]numMaxInterpolants

Size of the output interpolants array.

[out]numUsedInterpolants

Number of interpolants actually used.

Returns

TRUE if the input to this function is valid and the interpolation is successful, otherwise FALSE.


Anchor
a373847af2c0649d7e2012c738b27574f
a373847af2c0649d7e2012c738b27574f

bool Enlighten::ProbeSetManagerVoxel::GetProbeSetInterpolants

...

protected: bool GetProbeSetInterpolants
(
    const Geo::v128 & point,
    const Geo::u16 * probeSetsPropsSubsetIndices,
    Geo::u16 numSubsetIndices,
    ProbeInterpolant * interpolators,
    Geo::GeoPair< Geo::s32, bool > * pointInsideInnerVolume,
    Geo::s32 numMaxInterpolants,
    Geo::s32 & numUsedInterpolants
) const

...

Return Probe Set Interpolators.

The weights of the probe sets depend on the position of the query point in respect, to the bounding volumes of the Probe Sets.

Parameters
[in]point

The query point.

[in]probeSetsPropsSubsetIndices

Array of Probe Sets to consider. This is an array of indices into m_ProbeSetProps array. Only Probe Sets present in this array will be considered for interpolation.

[in]numSubsetIndices

Number of entries in probeSetsPropsSubsetIndices.

[out]interpolators

Probe interpolants with m_ProbeSetIndex and m_Weight set to an index into m_ProbeSetProps array and the weight of that Probe Set.

[out]pointInsideInnerVolume

an array that holds pairs of ProbeSet index and bool, where bool tells if "point" is inside inner volume of the Probe Set.

[in]numMaxInterpolants

Maximum number of Probe Sets to consider for interpolation.

[out]numUsedInterpolants

Number of used Probe Sets (number rof valid entries in interpolators array)

Returns

TRUE if the Probe Set Manager is initialised and Probe Sets for a given point can be retrieved, FALSE otherwise.


Anchor
a80a7e9f508a17b24a6a46cd54d874644
a80a7e9f508a17b24a6a46cd54d874644

ProbeSetProps const& Enlighten::ProbeSetManagerVoxel::GetProbeSetProps

...

public: ProbeSetProps const & GetProbeSetProps
(
    Geo::s32 index
) const

...

Get the ProbeSetProps for a given index.

That index is an index to m_ProbeSetProps array, which holds ProbeSetsProps sorted by their Guids. That index is also the index which is returned in ProbeInterpolant::m_ProbeSetIndex by the GetProbeInterpolants method.

Parameters
[in]index

The index of the Probe Set for which the ProbeSetProps is requested.

Returns

ProbeSetProps for the requested Probe Set index.


Anchor
aa291702725969f2dc11127bbf6007786
aa291702725969f2dc11127bbf6007786

Voxel const& Enlighten::ProbeSetManagerVoxel::GetVoxel

...

public: Voxel const & GetVoxel
(
    Geo::u32 index
) const

...

Get the voxel for a given index.

Voxels are stored in the m_Voxels and are sorted by their coordiantes.

Returns

Voxel at the given index.


Anchor
a9d8cbe7db70a45f7bc1c784d1604baed
a9d8cbe7db70a45f7bc1c784d1604baed

Geo::v128 const& Enlighten::ProbeSetManagerVoxel::GetVoxelSize

...

public: Geo::v128 const & GetVoxelSize() const

...

Get voxel size used by the Probe Set Manager.

Returns

Number of occupied voxels.


Anchor
a892f6b3827db1466638df53e4b41b61a
a892f6b3827db1466638df53e4b41b61a

bool Enlighten::ProbeSetManagerVoxel::Initialise

...

public: bool Initialise
(
    Geo::v128 voxelSize,
    float maxVolumeThreshold,
    RadProbeSetMetaData const *const * probeSets,
    Geo::u16 numProbeSets,
    size_t & memUsed
)

...

Initialise the class, construct the internal acceleration data structure.

Before calling this method the required internal memory needs to be allocated and set (via SetInternalMemory). Upper limit on required memory can be obtained via CalculateIntermalMemoryRequirement. Inputs to this method have to be the same as inputs to CalculateInternalMemoryRequirement.

This method will also return the actual amount of memory used in memUsed variable. This can be used to reinitialise the class with less memory.

Parameters
[in]voxelSize

The size of the voxel (the smaller the voxel to more memory will be needed)

[in]maxVolumeThreshold

Maximum ratio of probe set volume to voxel volume for a probe set to be voxelised.

[in]probeSets

Array of geometrical descriptions of all the probe sets that will be under the management.

[in]numProbeSets

Number of entries in probeSets array.

[out]memUsed

Actual memory used.

Returns

TRUE if initialisation was successful, FALSE otherwise.


Anchor
aef4fe6d265252aff0b0480b11fad94cd
aef4fe6d265252aff0b0480b11fad94cd

bool Enlighten::ProbeSetManagerVoxel::IsIndex1DensitySmallerThanIndex2Density

...

protected: bool IsIndex1DensitySmallerThanIndex2Density
(
    Geo::u16 index1,
    Geo::u16 index2
) const

...

Return true if Probe Set at index1 has smaller probe density than the one at index2.

Ties are broken by the Probe Set guids.

Parameters
[in]index1

[in]index2

Returns

TRUE if Probe Set at index1 has smaller probe density than the one at index2. FALSE, otherwise.


Anchor
ae5b041df40059bda9bcf9394d4e52f3f
ae5b041df40059bda9bcf9394d4e52f3f

bool Enlighten::ProbeSetManagerVoxel::IsInitialised

...

public: bool IsInitialised() const

...

Return an true if manager was successfully initialised.

Returns

true if manager was successfully initialised


Anchor
a053ddefaecd577d4cd475e68a563124a
a053ddefaecd577d4cd475e68a563124a

virtual bool Enlighten::ProbeSetManagerVoxel::MarkAllProbeSetsAsUnloaded

...

public: virtual bool MarkAllProbeSetsAsUnloaded()

...

Mark all Interpolation Set as unloaded.

Returns

TRUE if the input to this function is valid, Probe Set Manager is initialised, otherwise FALSE.


Anchor
adaeda92dc9dd1bde4cbee8af85dcdaac
adaeda92dc9dd1bde4cbee8af85dcdaac

virtual bool Enlighten::IProbeSetManager::MarkAllProbeSetsAsUnloaded

...

public: bool MarkAllProbeSetsAsUnloaded()

...

Marks all Interpolation Input Sets as unloaded.

Unloaded input sets are not used for interpolation.

Returns

TRUE if the InterpolationInputSet is under ProbeSetManager management and can be marked as unloaded, otherwise FALSE.


Anchor
ab719cc95437bc58e41998775f61fdca6
ab719cc95437bc58e41998775f61fdca6

virtual bool Enlighten::IProbeSetManager::MarkProbeSetAsLoaded

...

public: bool MarkProbeSetAsLoaded
(
    Enlighten::InterpolationInputSet const & loadedProbeSet
)

...

Marks given Interpolation Input Set as loaded.

Only loaded input sets are used for interpolation.

Parameters
[in]loadedProbeSet

The Interpolation Input Set to be marked as loaded. It has to contain a valid RadProbeSetCore field.

Returns

TRUE if the InterpolationInputSet is under ProbeSetManager management and can be marked as loaded, otherwise FALSE.


Anchor
a42eeae3985a32173b826bf0d34f2f51e
a42eeae3985a32173b826bf0d34f2f51e

virtual bool Enlighten::ProbeSetManagerVoxel::MarkProbeSetAsLoaded

...

public: virtual bool MarkProbeSetAsLoaded
(
    Enlighten::InterpolationInputSet const & loadedProbeSet
)

...

Mark given Interpolation Set as loaded, and provide run time data for it.

The loadedProbeSet needs to be valid and needs to have valid RadProbeSetCore pointer.

Parameters
[in]loadedProbeSet

Interpoaltion Set to be marked as loaded.

Returns

TRUE if the input to this function is valid, Probe Set Manager is initialised and the loadedProbeSet probe set is under Probe Set Manager management, otherwise FALSE.


Anchor
ae683cd02576dc511627662c5076c00c8
ae683cd02576dc511627662c5076c00c8

virtual bool Enlighten::ProbeSetManagerVoxel::MarkProbeSetAsUnloaded

...

public: virtual bool MarkProbeSetAsUnloaded
(
    Geo::GeoGuid const & unloadedProbeSet
)

...

Mark given Interpolation Set as unloaded.

This probe set will not be used for interpolation until it is marked as loaded again.

Parameters
[in]unloadedProbeSet

GUID of the Probe Set to be marked as unloaded.

Returns

TRUE if the input to this function is valid, Probe Set Manager is initialised and the unloadedProbeSet probe set is under Probe Set Manager management, otherwise FALSE.


Anchor
ab2c8361e6a68912686dd885cb28bb7f6
ab2c8361e6a68912686dd885cb28bb7f6

virtual bool Enlighten::IProbeSetManager::MarkProbeSetAsUnloaded

...

public: bool MarkProbeSetAsUnloaded
(
    Geo::GeoGuid const & unloadedProbeSet
)

...

Marks given Interpolation Input Set as unloaded.

Unloaded input sets are not used for interpolation.

Parameters
[in]unloadedProbeSet

The GUID of the Probe Set to be marked as unloaded.

Returns

TRUE if the InterpolationInputSet is under ProbeSetManager management and can be marked as unloaded, otherwise FALSE.


Anchor
abb7955d9492eafd3bc2b336ecdc5ec4a
abb7955d9492eafd3bc2b336ecdc5ec4a

virtual void Enlighten::IProbeSetManager::OnAllLoadedProbeSetsArrayChanged

...

public: virtual void OnAllLoadedProbeSetsArrayChanged
(
    Enlighten::InterpolationInputSet const * allLoadedProbeSets,
    Geo::s32 numLoadedProbeSets
)

...

Allows the probe set manager a chance to observe the contiguous memory block in which the runtime stores all loaded input sets.

The manager can then use this knowledge to speed up other operations as needed (e.g. if the manager's implementation of GetProbeInterpolants() uses the variant of Enlighten::GetProbeInterpolants() supporting multiple probe sets). Note that multiple load and unload notifications (as noted by MarkProbeSetAsLoaded and MarkProbeSetAsUnloaded, respectively) may be batched into a single call to this function.

Parameters
[in]allLoadedProbeSets

Starting address of the input set array managed by the runtime.

[in]numLoadedProbeSets

Size of the input set array.


Anchor
a81d315b34809deecc4fd5491601ee019
a81d315b34809deecc4fd5491601ee019

void Enlighten::ProbeSetManagerVoxel::SetInternalMemory

...

public: void SetInternalMemory
(
    void * mem,
    size_t memSize
)

...

Set the internal memory storage to an externally allocated mem pool.

Needs to be called before Initialise(). Setting new memory location requires object reinitialisation.

Parameters
[in]mem

Pointer to memory pool. Needs to have at least 4-bytes alignment.

[in]memSize

The size of the memory pool.


Anchor
a6ea82e2bbca4cb9db4a7ce81ff3c8563
a6ea82e2bbca4cb9db4a7ce81ff3c8563

virtual bool Enlighten::ProbeSetManagerVoxel::SetMaxWeightForProbeSet

...

public: virtual bool SetMaxWeightForProbeSet
(
    Geo::GeoGuid const & probeSet,
    float maxWeight
)

...

Set the maximum weight for a given Probe Set.

Parameters
[in]probeSet

GUID of the Probe Set to set the maximum weight for.

[in]maxWeight

The maximum weight - should be a float between 0.0 and 1.0.

Returns

TRUE if the input to this function is valid, Probe Set Manager is initialised and the probeSet probe set is under Probe Set Manager management, otherwise FALSE.


Anchor
aa546f8199b93bf894dfd8314f2670c2d
aa546f8199b93bf894dfd8314f2670c2d

virtual bool Enlighten::IProbeSetManager::SetMaxWeightForProbeSet

...

public: bool SetMaxWeightForProbeSet
(
    Geo::GeoGuid const & probeSet,
    float maxWeight
)

...

Set a maximum interpolation weight for the given Probe Set.

Needs to perform a search OLog(N). Where N is number of probe sets under management.

Parameters
[in]probeSet

The GUID of the Probe Set.

[in]maxWeight

New maximum interpolation weight. Has to be a value between 0.0 and 1.0

Returns

TRUE if the Probe Set is under ProbeSetManager management, otherwise FALSE.


Anchor
abf43422b3d622e9b498313672f292e97
abf43422b3d622e9b498313672f292e97

bool Enlighten::ProbeSetManagerVoxel::ShouldNotVoxeliseVolume

...

protected: bool ShouldNotVoxeliseVolume
(
    float volume
) const

...

Return true if given volume is too big to be voxelised.

Not voxelised volumes are stored in a separate list. GetProbeInterpolants method checks (O(N)) the list of all not voxelised volumes if it does not find a voxel information for a given query point. Having more not voxelised volumes decreases the memory usage but increases interpolation time. In general big volumes (that would result in a lot of voxels) should be left not voxelised (e.g. if there is one huge volume that covers the whole scene)

Parameters
[in]volume

Returns

TRUE if given volume should not be voxelised. FALSE, otherwise.