Exemple #1
0
        public BlendingInfo(BlendingParameters parameters)
        {
            switch (parameters.Mode)
            {
            case BlendingMode.Inherit:
            case BlendingMode.Mixture:
                Source           = BlendingFactorSrc.SrcAlpha;
                Destination      = BlendingFactorDest.OneMinusSrcAlpha;
                SourceAlpha      = BlendingFactorSrc.One;
                DestinationAlpha = BlendingFactorDest.One;
                break;

            case BlendingMode.Additive:
                Source           = BlendingFactorSrc.SrcAlpha;
                Destination      = BlendingFactorDest.One;
                SourceAlpha      = BlendingFactorSrc.One;
                DestinationAlpha = BlendingFactorDest.One;
                break;

            default:
                Source           = BlendingFactorSrc.One;
                Destination      = BlendingFactorDest.Zero;
                SourceAlpha      = BlendingFactorSrc.One;
                DestinationAlpha = BlendingFactorDest.Zero;
                break;
            }

            RGBEquation   = translateEquation(parameters.RGBEquation);
            AlphaEquation = translateEquation(parameters.AlphaEquation);
        }
 public DrawColourInfo(ColourInfo?colour = null, BlendingParameters?blending = null)
 {
     Colour   = colour ?? ColourInfo.SingleColour(Color4.White);
     Blending = blending ?? BlendingParameters.Inherit;
 }