add 2 new blend modes: Multiplicative, DoubleMultiplicative

This commit is contained in:
Matthias Mailänder
2015-04-04 12:35:03 +02:00
parent 9df371b393
commit 868e404b22
2 changed files with 13 additions and 1 deletions

View File

@@ -44,7 +44,9 @@ namespace OpenRA
SoftAdditive,
Translucency25,
Translucency50,
Translucency75
Translucency75,
Multiplicative,
DoubleMultiplicative
}
public interface IGraphicsDevice : IDisposable

View File

@@ -267,6 +267,16 @@ namespace OpenRA.Renderer.Sdl2
ErrorHandler.CheckGlError();
GL.BlendColor(1f, 1f, 1f, 0.75f);
break;
case BlendMode.Multiplicative:
GL.Enable(EnableCap.Blend);
ErrorHandler.CheckGlError();
GL.BlendFunc(BlendingFactorSrc.Zero, BlendingFactorDest.SrcColor);
break;
case BlendMode.DoubleMultiplicative:
GL.Enable(EnableCap.Blend);
ErrorHandler.CheckGlError();
GL.BlendFunc(BlendingFactorSrc.DstColor, BlendingFactorDest.SrcColor);
break;
}
ErrorHandler.CheckGlError();