| 105 | } |
| 106 | |
| 107 | void 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 |
nothing calls this directly
no test coverage detected