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

Method Draw

Source/Engine/Level/Actors/SkyLight.cpp:107–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void SkyLight::Draw(RenderContext& renderContext)
108{
109 float brightness = Brightness;
110 AdjustBrightness(renderContext.View, brightness);
111 const Float3 position = GetPosition() - renderContext.View.Origin;
112 if (EnumHasAnyFlags(renderContext.View.Flags, ViewFlags::SkyLights)
113 && EnumHasAnyFlags(renderContext.View.Pass, DrawPass::GBuffer)
114 && brightness > ZeroTolerance
115 && (ViewDistance < ZeroTolerance || Vector3::DistanceSquared(renderContext.View.Position, position) < ViewDistance * ViewDistance))
116 {
117 RenderSkyLightData data;
118 data.Position = position;
119 data.Color = Color.ToFloat3() * (Color.A * brightness);
120 data.VolumetricScatteringIntensity = VolumetricScatteringIntensity;
121 data.CastVolumetricShadow = CastVolumetricShadow;
122 data.AdditiveColor = AdditiveColor.ToFloat3() * (AdditiveColor.A * brightness);
123 data.IndirectLightingIntensity = IndirectLightingIntensity;
124 data.Radius = GetScaledRadius();
125 data.Image = GetSource();
126 data.StaticFlags = GetStaticFlags();
127 data.ID = GetID();
128 data.ScreenSize = Math::Min(1.0f, Math::Sqrt(RenderTools::ComputeBoundsScreenRadiusSquared(position, (float)_sphere.Radius, renderContext.View)));
129 renderContext.List->SkyLights.Add(data);
130 }
131}
132
133#if USE_EDITOR
134

Callers

nothing calls this directly

Calls 10

EnumHasAnyFlagsFunction · 0.85
GetSourceFunction · 0.85
GetStaticFlagsFunction · 0.85
GetIDFunction · 0.85
GetPositionFunction · 0.50
MinFunction · 0.50
SqrtFunction · 0.50
ToFloat3Method · 0.45
AddMethod · 0.45

Tested by

no test coverage detected