Skip to content

Commit 429f587

Browse files
committed
Corrected the headlight dimmer functionality
1 parent f4a7495 commit 429f587

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/RunActivity/Viewer3D/Lights.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ public void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
276276
LightConeDistance = 2 * MathHelper.Lerp(ActiveLightCone.Distance1, ActiveLightCone.Distance2, ActiveLightCone.Fade.Y);
277277
LightConeOuterAngle = MathHelper.Lerp(ActiveLightCone.Angle1, ActiveLightCone.Angle2, ActiveLightCone.Fade.Y);
278278
var lightConeColor = Vector4.Lerp(ActiveLightCone.Color1, ActiveLightCone.Color2, ActiveLightCone.Fade.Y);
279-
LightConeColor = new Vector3(lightConeColor.X, lightConeColor.Y, lightConeColor.Z) * lightConeColor.W;
279+
LightConeColor = new Vector3(lightConeColor.X, lightConeColor.Y, lightConeColor.Z);
280280

281-
frame.AddLight(LightMode.Spot, LightConePosition, LightConeDirection, LightConeColor, RenderFrame.HeadLightIntensity, LightConeDistance, 0, LightConeOuterAngle, ActiveLightCone.Fade.X, false);
281+
frame.AddLight(LightMode.Spot, LightConePosition, LightConeDirection, LightConeColor, RenderFrame.HeadLightIntensity * lightConeColor.W, LightConeDistance, 0, LightConeOuterAngle, ActiveLightCone.Fade.X, false);
282282
}
283283
else
284284
{

0 commit comments

Comments
 (0)