/
7.1.1.2.1. 入力ライティングの提供
This is the documentation for Enlighten.
7.1.1.2.1. 入力ライティングの提供
ライティングは直接入力ライティングと間接入力ライティングの 2 つのステージで提供されます。直接入力ライティング ステージでは、提供されたすべてのライトからサーフェスのライティングを計算し、間接入力ライティング ステージでは、直接入力ライティング ステージの結果に対し、バウンス、アルベド、一時的コヒーレンスの計算を適用します。その結果が InputLightingBuffer
です。
直接入力ライティング
間接入力ライティング ステージでは、ライト ポインターのソートされていないアレイ、ライトのアレイと一致する可視性ポインターのアレイ、有効な入力ワークスペース、トランスフォーム (ワールド空間で独立したシステムを移動させるために使用)、出力として使用される有効な IncidentLightingBuffer
を入力として受け取ります。
IncidentLightingBuffer の作成
Geo::u32 incidentLightingBufferSize = CalcIncidentLightingBufferSize(m_InputWorkspace); void* incidentLightingMemory = GEO_ALIGNED_MALLOC(incidentLightingBufferSize, 16); IncidentLightingBuffer* incidentLightingBuffer = CreateIncidentLightingBuffer(incidentLightingMemory, m_InputWorkspace); m_LightBankBuffers.Push(incidentLightingBuffer);
以下の関数を呼び出して一連のライトの直接光を計算します。
直接入力ライティングの例
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; // 可視性ポインターのリストを記述します WriteVisibilityPointers(wtd->m_ThreadVisibilityPointers, system, bankIter->first); Geo::u32 timeUs = 0; DoDirectInputLighting(¶ms, wtd->m_WorkingMemory, scrathSpaceSize, timeUs);
間接入力ライティング
以下の関数を呼び出して一連の入射光バッファから間接光を計算します。
間接入力ライティングの例
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(¶ms, timeUs);
カスタム入力ライティング
GPU などで独自に入力ライティングを計算する場合、以下の関数で一連のダスター値から入射光バッファを提供します。
bool GEO_CALL AddDusterValuesToInputWorkspace(const InputWorkspace* workspaceMemory, Enlighten::IncidentLightingBuffer* output, const Geo::v128* dusterValues);
, multiple selections available,
Related content
Material properties
Material properties
More like this
Enlighten UE5 4.01 Release Notes
Enlighten UE5 4.01 Release Notes
More like this
Enlighten UE5 4.02 Release Notes
Enlighten UE5 4.02 Release Notes
More like this
Use Enlighten in your project
Use Enlighten in your project
More like this
Troubleshooting and support
Troubleshooting and support
More like this
9. Efficient Enlighten lighting
9. Efficient Enlighten lighting
More like this