我正在尝试多次混合一些图形,但无法使它工作!!
以下是代码:
blendmultiply = new BlendState();
blendmultiply.ColorBlendFunction = BlendFunction.Add;
blendmultiply.ColorSourceBlend = Blend.DestinationColor;
blendmultiply.ColorDestinationBlend = Blend.SourceColor;
//BackGround
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, cam.get_transformation(GestionEcran.GraphicsDevice));
BackGround.Draw(spriteBatch, gameTime, 255);
spriteBatch.End();
//Character
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, cam.get_transformation(GestionEcran.GraphicsDevice));
Character.Draw(spriteBatch, gameTime, 255);
spriteBatch.End();
//MULTIPLY PROBLEM
spriteBatch.Begin(SpriteSortMode.Immediate, blendmultiply, null, null, null, null, cam.get_transformation(GestionEcran.GraphicsDevice));
multipliedeffecrs.Draw(spriteBatch, gameTime, 255);
spriteBatch.End();
//Foreground
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, cam.get_transformation(GestionEcran.GraphicsDevice));
ForeGround.Draw(spriteBatch, gameTime, 255);
spriteBatch.End();
但它只在我的png的透明部分上给出了黑色:
你知道为什么吗?感谢。