This is the documentation for Enlighten.
class Enlighten MaterialGuids
class Enlighten::MaterialGuids
Storage of mappings between "old" u64 material IDs and "new" instance, mesh and material GUIDs.
This class is optionally included in ClusterAlbedoWorkspaceMaterialData and is used for setting material properties using GUIDs.
Classes
Name | Description |
---|---|
Enlighten::MaterialGuids::GeometryInfo | Stored data for a geometry. |
Enlighten::MaterialGuids::InstanceInfo | Stored data for an instance. |
Enlighten::MaterialGuids::MaterialGuidMapping | Stored data for a material-guid mapping. |
Enlighten::MaterialGuids::MeshInfo | Stored data for a mesh. |
Functions
Name | Description |
---|---|
ConvertEndian(Geo::EConvertEndianMode) | Convert the endian-ness of this MaterialGuids. |
ConvertIdsAndIdxsToGuids(Geo::u16, Geo::u16, Geo::GeoGuid &, Geo::GeoGuid &) | Converts a given instance ID and mesh index to instance GUID and mesh GUID. |
ConvertIdsAndIdxsToGuids(Geo::u16, Geo::u16, Geo::u32, Geo::GeoGuid &, Geo::GeoGuid &, Geo::GeoGuid &) | Converts a given instance ID, mesh index and material ID to instance GUID, mesh GUID and material GUID. |
GetGeometries() | Raw access to the geometries array. |
GetGeometries() | Raw access to the geometries array. |
GetInstanceGuids(Geo::GeoGuid *) | Gets number of instances. If pointer is non-null will fill in the array with their guids. |
GetInstances() | Raw access to the instances array. |
GetInstances() | Raw access to the instances array. |
GetMaterialGuidMappings() | Raw access to the material GUID mappings array. |
GetMaterialGuidMappings() | Raw access to the material GUID mappings array. |
GetMaterialGuids(const Geo::GeoGuid &, const Geo::GeoGuid &, Geo::GeoGuid *) | Gets number of materials in the given instance and mesh (or all if GeoGuid::Invalid). If pointer is non-null will fill in the array with their guids. |
GetMaterialIdsFromGuids(const Geo::GeoGuid &, const Geo::GeoGuid &, const Geo::GeoGuid &, Geo::u64 *, Geo::s32 &, Geo::u64 &) | Fills in array of material IDs and a 64-bit mask specifying which bits need to mask, given instance, mesh and material GUIDs any of which can be GeoGuid::Invalid for "all". |
GetMeshes() | Raw access to the meshes array. |
GetMeshes() | Raw access to the meshes array. |
GetMeshGuids(const Geo::GeoGuid &, Geo::GeoGuid *) | Gets number of meshes in the given instance (or all if GeoGuid::Invalid). If pointer is non-null will fill in the array with their guids. |
Variables
Name | Description |
---|---|
Geo::u32 m_GeometriesOffset | Array of GeometryInfo (x m_NumGeometries) |
Geo::u32 m_InstancesOffset | Array of InstanceInfo (x m_NumInstances). Should be sorted by instance Guid to speed up lookups. |
Geo::u32 m_MaterialGuidMappingsOffset | Array of MaterialGuidMapping (x m_NumMaterialGuidMappings). This contains the material guid mappings for all the meshes concatenated together in one big array. Each sub-array (per-mesh) should be sorted by material Guid to speed up lookups. |
Geo::u32 m_MeshesOffset | Array of MeshInfo (x m_NumMeshes). This contains the MeshInfo for all the geometries concatenated together in one big array. Each sub-array (per geometry) should be sorted by mesh guid to speed up lookups. |
Geo::s32 m_NumGeometries | Number of geometries. |
Geo::s32 m_NumInstances | Number of instances. |
Geo::s32 m_NumMaterialGuidMappings | Total number of material Guid -> u32 material id mappings across all meshes. |
Geo::s32 m_NumMaterialInstances | Total uses of materials by all instances. |
Geo::s32 m_NumMeshes | Total number of meshes (summed across all Geometries) |
Geo::u32 m_ObjectSize | Size of this object (in bytes). |
void Enlighten::MaterialGuids::ConvertEndian
public: void ConvertEndian
(
  Geo::EConvertEndianMode mode
)
Convert the endian-ness of this MaterialGuids.
bool Enlighten::MaterialGuids::ConvertIdsAndIdxsToGuids
public: bool ConvertIdsAndIdxsToGuids
(
  Geo::u16 instanceId,
  Geo::u16 meshIdx,
  Geo::GeoGuid & outInstanceGuid,
  Geo::GeoGuid & outMeshGuid
) const
Converts a given instance ID and mesh index to instance GUID and mesh GUID.
bool Enlighten::MaterialGuids::ConvertIdsAndIdxsToGuids
public: bool ConvertIdsAndIdxsToGuids
(
  Geo::u16 instanceId,
  Geo::u16 meshIdx,
  Geo::u32 materialId,
  Geo::GeoGuid & outInstanceGuid,
  Geo::GeoGuid & outMeshGuid,
  Geo::GeoGuid & outMaterialGuid
) const
Converts a given instance ID, mesh index and material ID to instance GUID, mesh GUID and material GUID.
const GeometryInfo* Enlighten::MaterialGuids::GetGeometries
public: const GeometryInfo * GetGeometries() const
Raw access to the geometries array.
GeometryInfo* Enlighten::MaterialGuids::GetGeometries
public: GeometryInfo * GetGeometries()
Raw access to the geometries array.
Geo::s32 Enlighten::MaterialGuids::GetInstanceGuids
public: Geo::s32 GetInstanceGuids
(
  Geo::GeoGuid * pInstanceGuids
) const
Gets number of instances. If pointer is non-null will fill in the array with their guids.
const InstanceInfo* Enlighten::MaterialGuids::GetInstances
public: const InstanceInfo * GetInstances() const
Raw access to the instances array.
InstanceInfo* Enlighten::MaterialGuids::GetInstances
public: InstanceInfo * GetInstances()
Raw access to the instances array.
const MaterialGuidMapping* Enlighten::MaterialGuids::GetMaterialGuidMappings
public: const MaterialGuidMapping * GetMaterialGuidMappings() const
Raw access to the material GUID mappings array.
MaterialGuidMapping* Enlighten::MaterialGuids::GetMaterialGuidMappings
public: MaterialGuidMapping * GetMaterialGuidMappings()
Raw access to the material GUID mappings array.
Geo::s32 Enlighten::MaterialGuids::GetMaterialGuids
public: Geo::s32 GetMaterialGuids
(
  const Geo::GeoGuid & instanceGuid,
  const Geo::GeoGuid & meshGuid,
  Geo::GeoGuid * pMaterialGuids
) const
Gets number of materials in the given instance and mesh (or all if GeoGuid::Invalid). If pointer is non-null will fill in the array with their guids.
bool Enlighten::MaterialGuids::GetMaterialIdsFromGuids
public: bool GetMaterialIdsFromGuids
(
  const Geo::GeoGuid & instanceGuid,
  const Geo::GeoGuid & meshGuid,
  const Geo::GeoGuid & materialGuid,
  Geo::u64 * pMaterialIds,
  Geo::s32 & outNumMaterialIds,
  Geo::u64 & outMask
) const
Fills in array of material IDs and a 64-bit mask specifying which bits need to mask, given instance, mesh and material GUIDs any of which can be GeoGuid::Invalid for "all".
pMaterialIds should be pre-allocated and have at least as many elements as the number of material uses in the system (this is a conservative estimate)
const MeshInfo* Enlighten::MaterialGuids::GetMeshes
public: const MeshInfo * GetMeshes() const
Raw access to the meshes array.
MeshInfo* Enlighten::MaterialGuids::GetMeshes
public: MeshInfo * GetMeshes()
Raw access to the meshes array.
Geo::s32 Enlighten::MaterialGuids::GetMeshGuids
public: Geo::s32 GetMeshGuids
(
  const Geo::GeoGuid & instanceGuid,
  Geo::GeoGuid * pMeshGuids
) const
Gets number of meshes in the given instance (or all if GeoGuid::Invalid). If pointer is non-null will fill in the array with their guids.