Exemple #1
0
        public static bool IsPass(AlphaTestType type, float sourceAlpha, float targetAlpha)
        {
            switch (type)
            {
            case AlphaTestType.Greater: return(sourceAlpha > targetAlpha);

            case AlphaTestType.GEqual: return(sourceAlpha >= targetAlpha);

            case AlphaTestType.Less: return(sourceAlpha < targetAlpha);

            case AlphaTestType.LEqual: return(sourceAlpha <= targetAlpha);

            case AlphaTestType.Equal: return(sourceAlpha == targetAlpha);

            case AlphaTestType.NotEqual: return(sourceAlpha != targetAlpha);

            case AlphaTestType.Always: return(true);

            case AlphaTestType.Never: return(false);
            }
            return(true);
        }
Exemple #2
0
        //===================================================================

        public Material SetAlphaTest(AlphaTestType type, float alpha)
        {
            this.alphaTest      = type;
            this.alphaTestValue = alpha;
            return(this);
        }