This is the documentation for Enlighten.

class Enlighten IBakeInputSystem

class Enlighten::IBakeInputSystem

    └>Geo::IGeoSerialisable
        └>Geo::IGeoReleasable

A triangle list and GBuffer of the incoming system.

Functions

Name Description
AddMesh(const BakeInputMeshInfo &)

Call this for each mesh you want added, ensuring that the invisible meshes are not included in the standard lightmap, and that non-target meshes are not included in the Enlighten lightmap.

ComputeBoundingBox()

Lightmap UV debugging helpers.

Create()

Create a new IBakeInputSystem.

DilateTexture(Geo::GeoFp16Texture *)

Expand and dilate a provided albedo/emissive texture.

DumpPixelUVLayoutStats()

Various debugging helpers (can these be extracted into another API?)

DumpTriangleUVs(Geo::s32)

Various debugging helpers (can these be extracted into another API?)

Finalise()

Create GBuffers after all geometry is added.

GetBakePropertiesGuid()

Retrieves the GUID of the IBakeInputProperties passed into one of this class's methods.

GetBarycentricWeights(Geo::BaryWeights &, Geo::s32, Geo::v128)

Lightmap UV debugging helpers.

GetFaceIndex(const Geo::GeoGuid &, const Geo::s32 &, const Geo::s32 &, Geo::s32)

Map a mesh face index to a global bakesystem index.

GetFullName()

Get the full name.

GetHeight()

Returns the width and height of the internal GBuffer.

GetId()

The Guid for the IBakeInputSystem.

GetInstance(Geo::s32, Geo::GeoGuid &, Geo::s32 &, Geo::s32 &, Geo::s32 &, Geo::s32 &)

Get the geometry instances information.

GetIsUserLightmap()

Is this BakeSystem a user-defined lightmap (if not then it is an Enlighten system, used only for sampling indirect light).

GetLightmapUVs(Geo::s32)

Get the packed lightmap UVs for a geometry instance.

GetNumInstances()

Get the geometry instances information.

GetOutputIsIntensity()

Is this BakeSystem stores output as intensity value of the average light direction.

GetOutputType()

The output type for the system.

GetPixelBarycentricWeights(Geo::s32, Geo::s32, PixelBarycentricWeights &)

Extract barycentric weights for the pixel at this location.

GetPixelIndexForTriangle(Geo::s32 &, Geo::s32, const Geo::BaryWeights &)

Lightmap UV debugging helpers.

GetTriangleForUVCoordinate(float, float)

Lightmap UV debugging helpers.

GetUVCoordinateForTriangle(Geo::GeoPoint2 &, Geo::s32, const Geo::BaryWeights &)

Lightmap UV debugging helpers.

GetWidth()

Returns the width and height of the internal GBuffer.

LightMapHasBadUVFaces()

Lightmap UV debugging helpers.

Load(IGeoInputStream &, Geo::u32)

Load an instance of this class from an IGeoInputStream.

Release()

Free this object that was created within the Enlighten libraries.

Save(IGeoStream &, Geo::u32)

Save an instance of this class to an IGeoStream.

SaveChartUVLayoutEps(const char *, Geo::s32, Geo::s32)

Various debugging helpers (can these be extracted into another API?)

SaveLightmapUVDebuggingRaySets(const char *, const Geo::v128 &, const Geo::v128 &)

Various debugging helpers (can these be extracted into another API?)

SavePixelTrianglesEps(const char *, Geo::s32)

Various debugging helpers (can these be extracted into another API?)

SavePixelTrianglesRaySet(const char *, Geo::s32, const Geo::v128 &, const Geo::v128 &)

Various debugging helpers (can these be extracted into another API?)

SaveTrianglePixelsEps(const char *, Geo::s32)

Various debugging helpers (can these be extracted into another API?)

SaveTrianglePixelsRaySet(const char *, Geo::s32, const Geo::v128 &, const Geo::v128 &)

Various debugging helpers (can these be extracted into another API?)

SaveUVDebuggingRaySet(const char *, const Geo::v128 &, const Geo::v128 &)

Various debugging helpers (can these be extracted into another API?)

SaveUVLayoutEps(const char *, Geo::s32, Geo::s32)

Various debugging helpers (can these be extracted into another API?)

SetBakeProperties(const IBakeInputProperties *)

Set the baking properties for this system.

SetFullName(const char *)

Set a globally unique name.

SetId(Geo::GeoGuid)

The Guid for the IBakeInputSystem.

SetIsUserLightmap(bool)

Is this BakeSystem a user-defined lightmap (if not then it is an Enlighten system, used only for sampling indirect light).


virtual bool Enlighten::IBakeInputSystem::AddMesh


public: bool AddMesh
(
    const BakeInputMeshInfo & pMeshInfo
)


Call this for each mesh you want added, ensuring that the invisible meshes are not included in the standard lightmap, and that non-target meshes are not included in the Enlighten lightmap.

In order to use this method the bake properties must be set first.

Parameters
[in] pMeshInfo

Contains properties of the mesh to be added


virtual Geo::GeoBoundingBox Enlighten::IBakeInputSystem::ComputeBoundingBox


public: Geo::GeoBoundingBox ComputeBoundingBox() const


Lightmap UV debugging helpers.


static IBakeInputSystem* Enlighten::IBakeInputSystem::Create


public: IBakeInputSystem * Create()


Create a new IBakeInputSystem.


virtual Geo::v128* Enlighten::IBakeInputSystem::DilateTexture


public: Geo::v128 * DilateTexture
(
    Geo::GeoFp16Texture * texture
) const


Expand and dilate a provided albedo/emissive texture.

This should be done to the albedo and emissive textures used in UpdateRuntimeLighting to ensure that the texture sampling handles border pixels well.


virtual bool Enlighten::IBakeInputSystem::DumpPixelUVLayoutStats


public: bool DumpPixelUVLayoutStats() const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::DumpTriangleUVs


public: bool DumpTriangleUVs
(
    Geo::s32 debugFaceIndex
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::Finalise


public: bool Finalise()


Create GBuffers after all geometry is added.


virtual Geo::GeoGuid Enlighten::IBakeInputSystem::GetBakePropertiesGuid


public: Geo::GeoGuid GetBakePropertiesGuid()


Retrieves the GUID of the IBakeInputProperties passed into one of this class's methods.

Return the Invalid GUID if hasn't been set yet.


virtual bool Enlighten::IBakeInputSystem::GetBarycentricWeights


public: bool GetBarycentricWeights
(
    Geo::BaryWeights & triangleBarycentricWeights,
    Geo::s32 faceIndex,
    Geo::v128 position
) const


Lightmap UV debugging helpers.


virtual Geo::s32 Enlighten::IBakeInputSystem::GetFaceIndex


public: Geo::s32 GetFaceIndex
(
    const Geo::GeoGuid & sys,
    const Geo::s32 & instIdx,
    const Geo::s32 & meshIdx,
    Geo::s32 meshFaceIndex
) const


Map a mesh face index to a global bakesystem index.


virtual const char* Enlighten::IBakeInputSystem::GetFullName


public: const char * GetFullName() const


Get the full name.


virtual Geo::s32 Enlighten::IBakeInputSystem::GetHeight


public: Geo::s32 GetHeight() const


Returns the width and height of the internal GBuffer.

Note that this value is derived from the properties passed into the Finalise() method.


virtual Geo::GeoGuid Enlighten::IBakeInputSystem::GetId


public: Geo::GeoGuid GetId() const


The Guid for the IBakeInputSystem.


virtual bool Enlighten::IBakeInputSystem::GetInstance


public: bool GetInstance
(
    Geo::s32 idx,
    Geo::GeoGuid & oSys,
    Geo::s32 & oInstIdx,
    Geo::s32 & oMeshIdx,
    Geo::s32 & oNumFaces,
    Geo::s32 & oNumVerts
) const


Get the geometry instances information.


virtual bool Enlighten::IBakeInputSystem::GetIsUserLightmap


public: bool GetIsUserLightmap() const


Is this BakeSystem a user-defined lightmap (if not then it is an Enlighten system, used only for sampling indirect light).


virtual const Geo::GeoPoint2* Enlighten::IBakeInputSystem::GetLightmapUVs


public: const Geo::GeoPoint2 * GetLightmapUVs
(
    Geo::s32 bakeInstanceIdx
) const


Get the packed lightmap UVs for a geometry instance.


virtual Geo::s32 Enlighten::IBakeInputSystem::GetNumInstances


public: Geo::s32 GetNumInstances() const


Get the geometry instances information.


virtual bool Enlighten::IBakeInputSystem::GetOutputIsIntensity


public: bool GetOutputIsIntensity() const


Is this BakeSystem stores output as intensity value of the average light direction.


virtual EBakeType Enlighten::IBakeInputSystem::GetOutputType


public: EBakeType GetOutputType() const


The output type for the system.


virtual bool Enlighten::IBakeInputSystem::GetPixelBarycentricWeights


public: bool GetPixelBarycentricWeights
(
    Geo::s32 x,
    Geo::s32 y,
    PixelBarycentricWeights & out
) const


Extract barycentric weights for the pixel at this location.

Parameters
[in] x

X Coordinate.

[in] y

Y Coordinate.

[out] out

Mesh/Triangle identifier and the barycentric weights of the pixel center.

Note

Enlighten converts all incoming meshes to CCW winding order; this means that the Barycentric coordinates created here may require reinterpretation when applied back to the source mesh. Unity and Unreal are examples of engines that would require flipping the order of weights, as they store meshes in CW winding order.


virtual bool Enlighten::IBakeInputSystem::GetPixelIndexForTriangle


public: bool GetPixelIndexForTriangle
(
    Geo::s32 & pixelIndex,
    Geo::s32 triangleIndex,
    const Geo::BaryWeights & barycentricWeights
) const


Lightmap UV debugging helpers.


virtual Geo::s32 Enlighten::IBakeInputSystem::GetTriangleForUVCoordinate


public: Geo::s32 GetTriangleForUVCoordinate
(
    float u,
    float v
) const


Lightmap UV debugging helpers.


virtual bool Enlighten::IBakeInputSystem::GetUVCoordinateForTriangle


public: bool GetUVCoordinateForTriangle
(
    Geo::GeoPoint2 & uv,
    Geo::s32 triangleIndex,
    const Geo::BaryWeights & barycentricWeights
) const


Lightmap UV debugging helpers.


virtual Geo::s32 Enlighten::IBakeInputSystem::GetWidth


public: Geo::s32 GetWidth() const


Returns the width and height of the internal GBuffer.

Note that this value is derived from the properties passed into the Finalise() method.


virtual bool Enlighten::IBakeInputSystem::LightMapHasBadUVFaces


public: bool LightMapHasBadUVFaces() const


Lightmap UV debugging helpers.


virtual bool Geo::IGeoSerialisable::Load


public: bool Load
(
    IGeoInputStream & stream,
    Geo::u32 section
)


Load an instance of this class from an IGeoInputStream.

The stream must be ready to read from. You can load sections of an object by passing a bitmask representing the desired sections rather than Iff::AllSectionsMask, which will load all sections. It is also safe to call this method on an object multiple times with different section arguments to load multiple parts.


virtual void Geo::IGeoReleasable::Release


public: void Release()


Free this object that was created within the Enlighten libraries.

Expect this to behave in a similar way to calling 'delete(this)'


virtual bool Geo::IGeoSerialisable::Save


public: bool Save
(
    IGeoStream & stream,
    Geo::u32 section
) const


Save an instance of this class to an IGeoStream.

The stream must be ready to write to. You can save sections of an object by passing a bitmask representing the desired sections rather than Iff::AllSectionsMask, which will save all sections that are available.


virtual bool Enlighten::IBakeInputSystem::SaveChartUVLayoutEps


public: bool SaveChartUVLayoutEps
(
    const char * filename,
    Geo::s32 triangleIndex,
    Geo::s32 pixelIndex
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SaveLightmapUVDebuggingRaySets


public: bool SaveLightmapUVDebuggingRaySets
(
    const char * filenamePrefix,
    const Geo::v128 & scale,
    const Geo::v128 & offset
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SavePixelTrianglesEps


public: bool SavePixelTrianglesEps
(
    const char * filename,
    Geo::s32 pixelIndex
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SavePixelTrianglesRaySet


public: bool SavePixelTrianglesRaySet
(
    const char * filename,
    Geo::s32 pixelIndex,
    const Geo::v128 & scale,
    const Geo::v128 & offset
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SaveTrianglePixelsEps


public: bool SaveTrianglePixelsEps
(
    const char * filename,
    Geo::s32 triangleIndex
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SaveTrianglePixelsRaySet


public: bool SaveTrianglePixelsRaySet
(
    const char * filename,
    Geo::s32 triangleIndex,
    const Geo::v128 & scale,
    const Geo::v128 & offset
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SaveUVDebuggingRaySet


public: bool SaveUVDebuggingRaySet
(
    const char * filename,
    const Geo::v128 & scale,
    const Geo::v128 & offset
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SaveUVLayoutEps


public: bool SaveUVLayoutEps
(
    const char * filename,
    Geo::s32 triangleIndex,
    Geo::s32 pixelIndex
) const


Various debugging helpers (can these be extracted into another API?)


virtual bool Enlighten::IBakeInputSystem::SetBakeProperties


public: bool SetBakeProperties
(
    const IBakeInputProperties * pProps
)


Set the baking properties for this system.

This properties should be set in order to add meshes to this system.

Parameters
[in] pProps

Baking properties to use.

Returns

True if passed in valid properties, False if pProps is NULL or has an invalid Guid


virtual void Enlighten::IBakeInputSystem::SetFullName


public: void SetFullName
(
    const char * name
)


Set a globally unique name.


virtual void Enlighten::IBakeInputSystem::SetId


public: void SetId
(
    Geo::GeoGuid id
)


The Guid for the IBakeInputSystem.


virtual void Enlighten::IBakeInputSystem::SetIsUserLightmap


public: void SetIsUserLightmap
(
    bool v
)


Is this BakeSystem a user-defined lightmap (if not then it is an Enlighten system, used only for sampling indirect light).