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
    • The low level runtime
      • Low level runtime walkthrough
        • Preparing the runtime
        • Per-frame walkthrough
          • Providing input lighting
          • Solving for irradiance
          • Solving for directional irradiance
          • Solving for probe points
          • Probe interpolation
          • Resampling bounce
        • Multiple systems at runtime
        • Low level cubemap API
      • Input lighting
      • Debug 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.
/
Resampling bounce

    This is the documentation for Enlighten.

    Resampling bounce

    Nov 21, 2019

    Overview

    Once the solver has run, the runtime requires that the solve output data be transformed into a format fit for feeding back into the Indirect Input Lighting stage which expects the bounce to be in the Enlighten::BounceBuffer object. This can be done in one of two ways, depending on the source of the bounce.

    1. Lightmap bounce

    Lightmap bounce resampling
    if (system->m_RadSystemCore)
    {
        // Create the parameters struct.
    	ResampleBounceParameters bounceParams;
        // Assign the pointer to the BounceBuffer we wish to update.
    	bounceParams.m_BounceBuffer		= system->m_BounceBuffer;
        // Set the pointer to the systems rad core.
    	bounceParams.m_RadSystemCore	= system->m_RadSystemCore;
        // Set the pointer to the persistent data buffer. This is used for temporal coherence optimisations when quality is set to 0.0f.
    	bounceParams.m_PersistentData	= system->m_PresistentDataBuffer;
    
        // Create the struct for the texture sampling parameters.
    	ResampleTextureParameters hqBounce;
        // Set the pointer to the beginning of the texture pixels.
    	hqBounce.m_TextureData			= system->GetOutputPointer(ENLIGHTEN_OUTPUT_IRRADIANCE);
        // Set the width of the texture in pixels.
    	hqBounce.m_TextureWidth			= system->m_RadSystemCore->m_MetaData.m_OutputWidth;
        // Set the height of the texture in pixels.
    	hqBounce.m_TextureHeight		= system->m_RadSystemCore->m_MetaData.m_OutputHeight;
        // Set the row pitch in bytes.
    	hqBounce.m_TexturePitch			= system->GetOutputPitchInBytes(ENLIGHTEN_OUTPUT_IRRADIANCE);
       // Set the byte order of the pixel format.
    	hqBounce.m_ByteOrder			= m_OutputFormatByteOrder;
    	hqBounce.m_TextureFormat		= system->m_OutputFormat;
        // Set the rescale factor for fixed point formats. This is the inverse of the maximum representable value.
    	hqBounce.m_FixedPointRescale	= IsFixedPointFormat(system->m_OutputFormat) ? m_GlobalState.m_FpFormatRescale : 1.0f;
        // Set the desired quyality of the bounce resampling. 0.0 is lowest quality (best performance). 1.0 is best quality (lowest performance).
    	hqBounce.m_Quality				= m_GlobalState.m_BounceQuality;
        // Set the parameters.
    	bounceParams.m_ResampleTextureParams	= &hqBounce;
    
        // Call the function to resample the bounce into the BounceBuffer.
    	Enlighten::ResampleBounce(bounceParams, timeUs);
    }

    2. Probe bounce

    The bounce from probe radiosity systems can be resampled by calling Enlighten::UpdateProbeBounceBuffer().

    Probe bounce resampling
    if (system->IsBounceProbeSampled() &&
    		system->m_ProbeBounceWorkspace &&
    		m_InterpolationInputSets.GetSize() > 0)
    	{
    		if (m_ProbeSetManager != NULL)
    		{
    			Enlighten::UpdateProbeBounceBuffer(system->m_InputWorkspace,
    				system->m_ProbeBounceWorkspace,
    				system->m_BounceBuffer,
    				m_ProbeSetManager,
    				system->m_ProbeBounceInputSetsUsed != m_InterpolationInputSets.GetSize() || requiresProbeInterpolationUpdate);
    		}
    		else
    		{
    			Enlighten::UpdateProbeBounceBuffer(system->m_InputWorkspace,
    				system->m_ProbeBounceWorkspace,
    				system->m_BounceBuffer,
    				m_InterpolationInputSets.GetArray(),
    				m_InterpolationInputSets.GetSize(),
    				system->m_ProbeBounceInputSetsUsed != m_InterpolationInputSets.GetSize() || requiresProbeInterpolationUpdate);
    		}
    
    		system->m_ProbeBounceInputSetsUsed = m_InterpolationInputSets.GetSize();
    	}
    

    3. Set Indirect input lightintg parameters

    Once the BounceBuffer has been updated, it should be set as input on the IndirectInputLightingParameters struct before calling the DoIndirectInputLighting() function.

    Indirect input lighting parameters.
    Enlighten::IndirectInputLightingParameters params;
    //...
    params.m_BounceBuffer				= system->m_BounceBuffer;
    //...
    
    , multiple selections available,
    {"serverDuration": 9, "requestCorrelationId": "4003351ea88f4f37814331276fb2b07d"}