I'm fading an object from fully visible to transparent, but the fade darkens the object.
this.Color = Color.Lerp(Color.White, Color.Transparent, weight);
The object does fade to transparent, but.. It becomes darker and more transparent. There used to be a Color.TransparentWhite and Color.TransparentBlack in the non-premultiplied alpha xna world. How can I make the fade to transparent make the object fade through white to transparent with premultiplied alpha?
We are drawing sprites as quads using GraphicsDevice.DrawUserIndexedPrivitives and BlendState set to BlendState.AlphaBlend. This is supposed to do premultiplied alpha blending in XNA4.
Also, how the color is used in the rendering:
effect.Alpha = this.Color.A / 255f; effect.DiffuseColor = new Vector3(this.Color.R / 255f, this.Color.G / 255f, this.Color.B / 255f)
I suspect I should not use premultiplied alpha when using Alpha and DiffuseColor to make sprites/texts transparent. However when I use Color.Lerp to fade to new Color(1,1,1,0) it still darkens.