Ejemplo n.º 1
0
        public override void SetBlendMode(BlendMode blendMode)
        {
            if (currentBlendMode == blendMode)
            {
                return;
            }
            currentBlendMode = blendMode;
            switch (blendMode)
            {
            case BlendMode.Opaque:
                GLCore.Disable(EnableCap.Blend);
                break;

            case BlendMode.Normal:
                GLCore.Enable(EnableCap.Blend);
                GLCore.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
                GLCore.BlendEquation(BlendEquationMode.FuncAdd);
                break;

            case BlendMode.AlphaTest:
                GLCore.Disable(EnableCap.Blend);
                GLCore.Enable(EnableCap.AlphaTest);
                break;

            case BlendMode.Additive:
                GLCore.Enable(EnableCap.Blend);
                GLCore.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.One);
                GLCore.BlendEquation(BlendEquationMode.FuncAdd);
                break;

            case BlendMode.Subtractive:
                GLCore.Enable(EnableCap.Blend);
                GLCore.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.One);
                GLCore.BlendEquation(BlendEquationMode.FuncReverseSubtract);
                break;

            case BlendMode.LightEffect:
                GLCore.Enable(EnableCap.Blend);
                GLCore.BlendFunc(BlendingFactorSrc.DstColor, BlendingFactorDest.One);
                GLCore.BlendEquation(BlendEquationMode.FuncAdd);
                break;
            }
        }
Ejemplo n.º 2
0
 public override void EnableDepthTest()
 {
     GLCore.Enable(EnableCap.DepthTest);
 }
Ejemplo n.º 3
0
 private void NativeEnableCulling()
 {
     GLCore.Enable(EnableCap.CullFace);
     GLCore.CullFace(CullFaceMode.Back);
 }