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
  • Technical reference
    • Output formats
    • Albedo handling
    • Lightmap lighting models
    • Light probe evaluation
    • Local IBL reflections
    • Light visibility data
    • Custom direct lights
    • Precompute pipeline
    • Low level precompute API
    • Debugging the precompute
      • Debugging with IClusteringOutput
      • Debugging with ILightTransportOutput
    • The low level runtime
    • Baked lighting
    • Performance tuning
    • Technical troubleshooting
    • Terrain LOD
    • Probe LOD
    • Lightmap LOD
  • 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.
/
Debugging with IClusteringOutput

    This is the documentation for Enlighten.

    Debugging with IClusteringOutput

    Nov 21, 2019

    The IClusteringOutput object contains the following:

    • Mesh data that can be used to render the leaf clusters
    • Positions and normals for each of the duster points
    • Internal data, used to develop the algorithms

    The items of interest are the first two: cluster meshes and duster points.

    Loading the data

    Usually at runtime you simply create a new IClusteringOutput object, and serialise the data into it.

    IClusteringOutput* clustering = LoadInterface<IClusteringOutput>("<myfilename>");
    

    If you are not using the LoadInterface helper functions, call Create and then Load yourself.

    Cluster meshes

    There is one GeoTriangleList for each leaf mesh. Each triangle is just three vertex locations. Converting this into a format that is suitable for rendering is an implementation issue.

    Duster points

    For each cluster there is also a list of duster point locations and normals. The indices of these correspond to the dusters in the radCore.

    Sample code

    The following code fills the data object with the triangle vertices, and a colour for each cluster that is the colour of the cluster input lighting. This very useful visualisation shows how the input lighting is being applied to the system. If you just want to see clusters, use a random colour instead of extracting duster lighting.

    s32 litPoints	= Enlighten::GetNumberOfPointsInInputWorkspace(workspace);
    s32 litClusters	= Enlighten::GetNumberOfClustersInInputWorkspace(workspace);
    
    GEO_ASSERT(clustering->GetNumLeafClusters() == litClusters);
    
    Enlighten::InputWorkspaceDebugPoint debugPoint;
    s32 duster = 0;
    for (s32 n=0; n<clustering->GetNumLeafClusters(); n++)
    {
    	// Copy triangle position data
    	data.ClusterTriangles[n] = clustering->GetClusterMesh(n);
    
    	// Extract triangle colour data
    	Enlighten::GetInputWorkspaceLitDebugPoint(workspace, &debugPoint, duster, lightingBuffer);
    	data.ClusterColours[n] = VConstruct(
    		debugPoint.m_LightValue[0],			// red colour for cluster n
    		debugPoint.m_LightValue[1],			// green colour for cluster n
    		debugPoint.m_LightValue[2],			// blue colour for cluster n
    		1.0f);
    
    	s32 dusterCount = clustering->GetDusterPoints(n)->GetSize();
    	duster += dusterCount;
    }
    GEO_ASSERT(duster == litPoints);
    

    Note that all dusters within a cluster have the same input lighting, so you need to read only one of them per cluster. Then increment the system-wide duster index by the number of dusters in this cluster.

    , multiple selections available,
    {"serverDuration": 11, "requestCorrelationId": "1a748c5af7bf4acc89495d5009e11708"}