Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)

Enlighten SDK 3.10 Documentation
Results will update as you type.
  • Welcome to Enlighten
  • How Enlighten works
  • Artist workflow
  • Install Enlighten
  • Libraries
  • Implementation guide
    • The Enlighten scene
    • The precompute process
    • The lightmap UV pipeline
    • Enlighten runtime data
      • Lightmap UV data
      • Persistent radiosity data
      • Material colour data
      • Albedo and emissive textures
    • Runtime radiosity updates
    • Sample implementation
  • Technical reference
  • Advanced techniques
  • Tools
  • Enlighten Mobile
  • White papers
  • Third-party licences
  • Release notes
    Calendars

You‘re viewing this with anonymous access, so some content might be blocked.
/
Lightmap UV data

    This is the documentation for Enlighten.

    Lightmap UV data

    Nov 21, 2019

    The precompute generates lightmap UV data for each radiosity system.

    Instance lightmap UVs

    To extract the lightmap UV data for all instances in a radiosity system, load the IPrecompPackedSystem object.

    // path: "precomp/[system name].pas"
    const Enlighten::IPrecompPackedSystem* packedSystem
    	= Geo::LoadInterfaceCompressed<Enlighten::IPrecompPackedSystem>(path);

    If the instances within this system are lit using probes, the system does not have lightmap UV data and IPrecompPackedSystem::GetOutputWidth returns zero.

    Call IPrecompPackedSystem::GetPackedInstances to obtain lightmap UV information for each instance.

    Each IPrecompPackedInstance object corresponds to an instance object within the system.

    for(Geo::s32 i = 0; i != packedSystem->GetNumInstances(); ++i)
    {
    	const Enlighten::IPrecompPackedInstance* packedInstance = packedSystem->GetPackedInstances()[i];
    }

    Call IPrecompPackedInstance::GetInstanceGuid to get the instance GUID and use it to find the corresponding instance object.

    Shared lightmap UVs

    We recommend to share lightmap UVs between instances that refer to the same geometry object.

    To get started quickly, use unique UVs for each instance. To do this, call IPrecompPackedInstance::GetOutputUvArray to obtain pre-transformed lightmap UVs for each instance.

    To obtain the shared UV data, load the IPrecompPackedGeometry object.

    // path: "precomp/[geometry name].pag"
    const Enlighten::IPrecompPackedGeometry* packedGeometry
    	= Geo::LoadInterfaceCompressed<Enlighten::IPrecompPackedGeometry>(path);

    Use IPrecompPackedGeometry::GetOutputUvArray to obtain shared lightmap UVs, and IPrecompPackedInstance::GetUvTransform to get the UV transform for each instance.

    The meshes within IPrecompPackedInstance and IPrecompPackedGeometry are stored in the same order as the geometry object to which the instance refers.

    The vertices within the output UV array are laid out in exactly the same way as the vertices in the input mesh.

    If you provided each input mesh object with a vertex array laid out the same way as your rendered mesh, you do not need to re-order the vertices in the UV array. To render the mesh with Enlighten lightmaps you can simply add the UV array as a new vertex data stream.

    As you extract the UV data, convert it to a persistent form ready to load and render in your game. 16-bit fixed point provides sufficient precision.

    , multiple selections available,
    {"serverDuration": 24, "requestCorrelationId": "e09ee76e1c004e8d827ec1f3964fb024"}