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.
/
Providing input lighting

    This is the documentation for Enlighten.

    Providing input lighting

    Nov 21, 2019


    Lighting is provided in two stages; direct input lighting and indirect input lighting. The direct input lighting stage computes the surface lighting from all the provided lights, and the indirect input lighting stage applies bounce, albedo and temporal coherence calculations to the results of the direct input lighting stage. The result is an InputLightingBuffer.

    Direct input lighting

    The indirect input lighting stage takes as input an unsorted array of light pointers, an array of visibility pointers to match the array of lights, a valid input workspace, a transform (useful to move an independent system in world space), and a valid IncidentLightingBuffer which will be used as output.

    Creating an IncidentLightingBuffer
    Geo::u32 incidentLightingBufferSize = CalcIncidentLightingBufferSize(m_InputWorkspace);
    	void* incidentLightingMemory = GEO_ALIGNED_MALLOC(incidentLightingBufferSize, 16);
    	IncidentLightingBuffer* incidentLightingBuffer = CreateIncidentLightingBuffer(incidentLightingMemory, m_InputWorkspace);
    	m_LightBankBuffers.Push(incidentLightingBuffer);
    

    Call the following function to calculate the direct lighting for a set of lights:

    Direct Input Lighting example
    Enlighten::DirectInputLightingParameters params;
    					params.m_InputWorkspace					= system->GetInputWorkspace();
    					params.m_NumLights						= m_TotalNumLights;
    					params.m_InputLights					= lightsArray;
    					params.m_Transform						= NULL;
    					params.m_IncidentLightingBufferResult	= system->GetLightBankBuffer(bankIter->first);
    					params.m_ThreadVisibilityPointers		= wtd->m_ThreadVisibilityPointers;
    
    					// write the list of visibility pointers
    					WriteVisibilityPointers(wtd->m_ThreadVisibilityPointers, system, bankIter->first);
    
    Geo::u32 timeUs = 0;
    					DoDirectInputLighting(&params, wtd->m_WorkingMemory, scrathSpaceSize, timeUs);
    

    Indirect input lighting

    Call the following function to calculate the indirect lighting from a set of incident lighting buffers:

    Indirect Input Lighting example
    Enlighten::IndirectInputLightingParameters params;
    
    			IncidentLightingBuffer* incidentLightingBuffer = cpuDynamicObject->GetIncidentLightingBuffer();
    			params.m_IncidentLightingBuffers			= &incidentLightingBuffer;
    			params.m_NumIncidentInputLightingBuffers	= 1;
    			params.m_EmissiveTextureData				= NULL;
    			params.m_AlbedoTextureData					= NULL;
    			params.m_EmissiveScale						= Geo::VZero();
    			params.m_BounceData							= NULL;
    			params.m_BounceScale						= Geo::VBroadcast(m_GlobalState.m_BounceScale);
    			params.m_InputWorkspace						= dynamicObject->m_InputWorkspace;
    			params.m_ClusterAlbedoWorkspace				= dynamicObject->m_ClusterAlbedoWorkspace;
    			params.m_InputLightingBufferResult			= dynamicObject->m_InputLightingBuffer;
    			params.m_InputLightingSurroundings			= dynamicObject->m_InputLightingSurroundings;
    
    			Geo::u32 timeUs=0;
    			DoIndirectInputLighting(&params, timeUs);
    

    Custom input lighting

    If you compute your own input lighting, perhaps on the GPU, provide an incident lighting buffer from a set of duster values with the following function:

    bool GEO_CALL		AddDusterValuesToInputWorkspace(const InputWorkspace* workspaceMemory, Enlighten::IncidentLightingBuffer* output, const Geo::v128* dusterValues);
    
    , multiple selections available,
    {"serverDuration": 11, "requestCorrelationId": "4c7af5ac15ea429b8c9b3d023b60a5a0"}