Unable to blend correct colors

May 27, 2013 at 11:29 PM
I need help getting the proper ambient and light colors to display please. I was trying to create a black background with a white light on the character but all the lights are being blended with black, resulting in purple instead of white. Here's what it looks like.

I thought it was a consequence of blending with a dark background so I tried setting krypton.AmbientColor = Color.White but that made the entire background purple, not white. Then I tried to debug by replacing every instance of Color.Black in the code with Color.CornflowerBlue, including within Krypton's files, but that changed nothing.

Here's my draw.
ScreenManager.GraphicsDevice.Clear(ClearOptions.Target, Color.CornflowerBlue, 0, 0);
Matrix view = camera.getTransform(ScreenManager);
this.krypton.Matrix = view;
this.krypton.AmbientColor = Color.CornflowerBlue;
this.krypton.Bluriness = 3;
this.krypton.LightMapPrepare();
this.krypton.Draw(gameTime);
Before LightMapPrepare, it looks like this, which is the expected result.
After LightMapPrepare, it looks like this, which seems to be where the colors are getting skewed since it is all purple.
After krypton.Draw, the final result is this, with all the colors shifted to darker hues. White has become purple, cornflower blue has become dark blue. Since I have removed anything that would be drawing black layers, I am stumped.

I haven't seen anyone else report the same problem so I'm not sure what is causing this abnormality. Can anyone suggest a possible solution or further debugging steps?

Thank you very much.
May 28, 2013 at 12:12 AM
Oh good, one of those moments where you figure it out yourself as soon as you ask for help. It seems like I needed to clear the graphics device after preparing the light map.
ScreenManager.GraphicsDevice.Clear(ClearOptions.Target, Color.CornflowerBlue, 0, 0);
Matrix view = camera.getTransform(ScreenManager);
this.krypton.Matrix = view;
this.krypton.AmbientColor = Color.CornflowerBlue;
this.krypton.Bluriness = 3;
this.krypton.LightMapPrepare();
ScreenManager.GraphicsDevice.Clear(Color.White);
this.krypton.Draw(gameTime);
Now I'm swimming in colors! It went a little something like this.
Jun 7, 2013 at 2:13 PM
Curios question here. How are you doing the shadow hull on the L shape block?
Jun 15, 2013 at 5:38 AM
I'm sorry I didn't respond sooner, CyberEgg. I have been very busy. I achieved this shadow effect by reducing the number of edges that Krypton generated between vertices. It was a quick fix to achieve the results I wanted at the time, but it doesn't look right when you are not drawing fully opaque textures over all bodies that cast shadows. I will post back here with my improved solution when I have time to revisit the issue.