MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetupLight

Method SetupLight

Source/Engine/Renderer/ShadowsPass.cpp:626–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624}
625
626void ShadowsPass::SetupLight(ShadowsCustomBuffer& shadows, RenderContext& renderContext, RenderContextBatch& renderContextBatch, RenderLightData& light, ShadowAtlasLight& atlasLight)
627{
628 // Copy light properties
629 atlasLight.Sharpness = light.ShadowsSharpness;
630 atlasLight.Fade = light.ShadowsStrength;
631 atlasLight.NormalOffsetScale = light.ShadowsNormalOffsetScale * NormalOffsetScaleTweak * (1.0f / (float)atlasLight.Resolution);
632 atlasLight.Bias = light.ShadowsDepthBias;
633 atlasLight.FadeDistance = Math::Max(light.ShadowsFadeDistance, 0.1f);
634 atlasLight.Distance = Math::Min(renderContext.View.Far, light.ShadowsDistance);
635 atlasLight.Bounds.Center = light.Position + renderContext.View.Origin; // Keep bounds in world-space to properly handle DirtyStaticBounds
636 atlasLight.Bounds.Radius = 0.0f;
637
638 // Adjust bias to account for lower shadow quality
639 if (shadows.MaxShadowsQuality == 0)
640 atlasLight.Bias *= 1.5f;
641}
642
643bool ShadowsPass::SetupLight(ShadowsCustomBuffer& shadows, RenderContext& renderContext, RenderContextBatch& renderContextBatch, RenderLocalLightData& light, ShadowAtlasLight& atlasLight)
644{

Callers

nothing calls this directly

Calls 15

DistanceFunction · 0.85
SaturateFunction · 0.85
EnumHasAllFlagsFunction · 0.85
IsPowerOfTwoFunction · 0.85
ClampFunction · 0.85
Float4Class · 0.85
Float3Class · 0.85
DotFunction · 0.85
ScalingFunction · 0.85
ValidateCacheMethod · 0.80
InitStaticAtlasMethod · 0.80
FreeStaticMethod · 0.80

Tested by

no test coverage detected