| 80 | } |
| 81 | |
| 82 | void PointLight::Draw(RenderContext& renderContext) |
| 83 | { |
| 84 | float brightness = ComputeBrightness(); |
| 85 | AdjustBrightness(renderContext.View, brightness); |
| 86 | Float3 position; |
| 87 | const float radius = GetScaledRadius(); |
| 88 | if (EnumHasAnyFlags(renderContext.View.Flags, ViewFlags::PointLights) |
| 89 | && EnumHasAnyFlags(renderContext.View.Pass, DrawPass::GBuffer) |
| 90 | && brightness > ZeroTolerance |
| 91 | && radius > ZeroTolerance |
| 92 | && CheckViewDistance(renderContext.View.Position, renderContext.View.Origin, position, brightness)) |
| 93 | { |
| 94 | RenderPointLightData data; |
| 95 | data.Position = position; |
| 96 | data.MinRoughness = MinRoughness; |
| 97 | data.ShadowsDistance = ShadowsDistance; |
| 98 | data.Color = Color.ToFloat3() * (Color.A * brightness); |
| 99 | data.ShadowsStrength = ShadowsStrength; |
| 100 | data.Direction = _direction; |
| 101 | data.ShadowsFadeDistance = ShadowsFadeDistance; |
| 102 | data.ShadowsNormalOffsetScale = ShadowsNormalOffsetScale; |
| 103 | data.ShadowsDepthBias = ShadowsDepthBias; |
| 104 | data.ShadowsSharpness = ShadowsSharpness; |
| 105 | data.VolumetricScatteringIntensity = VolumetricScatteringIntensity; |
| 106 | data.CastVolumetricShadow = CastVolumetricShadow; |
| 107 | data.ShadowsUpdateRate = ShadowsUpdateRate; |
| 108 | data.ShadowsUpdateRateAtDistance = ShadowsUpdateRateAtDistance; |
| 109 | data.ShadowFrame = _invalidateShadowFrame; |
| 110 | data.ShadowsResolution = (int32)ShadowsResolution; |
| 111 | data.ShadowsMode = ShadowsMode; |
| 112 | data.Radius = radius; |
| 113 | data.FallOffExponent = FallOffExponent; |
| 114 | data.UseInverseSquaredFalloff = UseInverseSquaredFalloff; |
| 115 | data.SourceRadius = SourceRadius; |
| 116 | data.SourceLength = SourceLength; |
| 117 | data.ContactShadowsLength = ContactShadowsLength; |
| 118 | data.IndirectLightingIntensity = IndirectLightingIntensity; |
| 119 | data.IESTexture = IESTexture ? IESTexture->GetTexture() : nullptr; |
| 120 | data.StaticFlags = GetStaticFlags(); |
| 121 | data.ID = GetID(); |
| 122 | data.ScreenSize = Math::Min(1.0f, Math::Sqrt(RenderTools::ComputeBoundsScreenRadiusSquared(position, (float)_sphere.Radius, renderContext.View))); |
| 123 | renderContext.List->PointLights.Add(data); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | #if USE_EDITOR |
| 128 |
nothing calls this directly
no test coverage detected