diff --git a/Engine.Integration/Engine.Integration.MonoGame/MonoGameTriangleBatch.cs b/Engine.Integration/Engine.Integration.MonoGame/MonoGameTriangleBatch.cs index da575f6..73cf212 100644 --- a/Engine.Integration/Engine.Integration.MonoGame/MonoGameTriangleBatch.cs +++ b/Engine.Integration/Engine.Integration.MonoGame/MonoGameTriangleBatch.cs @@ -39,7 +39,7 @@ public class MonoGameTriangleBatch : Behaviour, ITriangleBatch, IFirstFrameUpdat Vector2 A = triangle.A.ToVector2(); Vector2 B = triangle.B.ToVector2(); Vector2 C = triangle.C.ToVector2(); - Color color = colorRGBA.ToColor(); + Color color = colorRGBA.ToPreMultipliedColor(); vertices[verticesIndex++] = new(new(A.X, A.Y, 0f), color); vertices[verticesIndex++] = new(new(B.X, B.Y, 0f), color); @@ -60,6 +60,8 @@ public class MonoGameTriangleBatch : Behaviour, ITriangleBatch, IFirstFrameUpdat return; graphicsDevice.RasterizerState = rasterizerState; + graphicsDevice.BlendState = BlendState.AlphaBlend; + basicEffect.Projection = projection; basicEffect.View = view; vertexBuffer.SetData(vertices); @@ -67,8 +69,10 @@ public class MonoGameTriangleBatch : Behaviour, ITriangleBatch, IFirstFrameUpdat graphicsDevice.SetVertexBuffer(vertexBuffer); foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) + { pass.Apply(); - graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, verticesIndex / 3); + graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, verticesIndex / 3); + } verticesIndex = 0; }