SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GetDirectionalLight()

void Spices::Renderer::GetDirectionalLight ( FrameInfo & frameInfo,
std::array< SpicesShader::DirectionalLight, SpicesShader::DIRECTIONALLIGHT_BUFFER_MAXNUM > & dLightBuffer )
protectedinherited

Get DirectionalLightComponent's render data in World.

Parameters
[in]frameInfoThe current frame data.
[out]dLightBufferDirectionalLight.
Todo
Multiple directional light.

@breif Iter DirectionalLightComponent, and just use the first one.

End of DirectionalLightBuffer.

@breif Iter DirectionalLightComponent, and just use the first one.

End of DirectionalLightBuffer.

Definition at line 371 of file Renderer.cpp.

372 {
374
378 int index = 0;
379 IterWorldCompWithBreak<DirectionalLightComponent>(
380 frameInfo,
381 [&](
382 int entityId,
383 const TransformComponent& tranComp,
384 DirectionalLightComponent& dirlightComp
385 ) {
386
387 SpicesShader::DirectionalLight directionalLight = dirlightComp.GetLight();
388 directionalLight.rotationMatrix = tranComp.GetRotateMatrix();
389 dLightBuffer[index] = directionalLight;
390 index++;
391 return false;
392 });
393
397 dLightBuffer[index].intensity = -1000.0f;
398 }
#define SPICES_PROFILE_ZONE

References Spices::DirectionalLightComponent::GetLight().

Referenced by Spices::RayTracingRenderer::Render(), and Spices::SceneComposeRenderer::Render().