diff --git a/Effects/PBREffect.cs b/Effects/PBREffect.cs index daf85b1..efe9cd2 100644 --- a/Effects/PBREffect.cs +++ b/Effects/PBREffect.cs @@ -7,6 +7,7 @@ namespace Kav { private readonly Vector3[] positions = new Vector3[4]; private readonly Vector3[] colors = new Vector3[4]; + private readonly float[] intensities = new float[4]; readonly EffectParameter lightPositionsParam; readonly EffectParameter lightColorsParam; @@ -21,20 +22,23 @@ namespace Kav { get { + var color = colors[i] / intensities[i]; return new PointLight( positions[i], new Color( - colors[i].X, - colors[i].Y, - colors[i].Z, + color.X, + color.Y, + color.Z, 1f - ) + ), + intensities[i] ); } set { positions[i] = value.Position; colors[i] = value.Color.ToVector3() * value.Intensity; + intensities[i] = value.Intensity; lightPositionsParam.SetValue(positions); lightColorsParam.SetValue(colors); }