public static IEnumerable <string> GetPassRenderStates(this ShapesBlendMode blendMode)
        {
            yield return("Cull Off");

            yield return("ZTest [_ZTest]");

            yield return("Offset [_ZOffsetFactor], [_ZOffsetUnits]");

            if (blendMode.ZWrite() == false)
            {
                yield return("ZWrite Off");
            }
            if (blendMode.AlphaToMask())
            {
                yield return("AlphaToMask On");
            }
            if (blendMode.HasSpecialBlendMode())
            {
                if (blendMode == ShapesBlendMode.Subtractive)
                {
                    yield return("BlendOp RevSub");
                }
                else if (blendMode == ShapesBlendMode.Lighten)
                {
                    yield return("BlendOp Max");
                }
                else if (blendMode == ShapesBlendMode.Darken)
                {
                    yield return("BlendOp Min");
                }
                yield return($"Blend {blendMode.GetShaderBlendMode()}");
            }
        }
Exemple #2
0
        public static IEnumerable <string> GetPassRenderStates(this ShapesBlendMode blendMode)
        {
            yield return("Cull Off");

            if (blendMode.ZWrite() == false)
            {
                yield return("ZWrite Off");
            }
            if (blendMode.AlphaToMask())
            {
                yield return("AlphaToMask On");
            }
            if (blendMode.HasSpecialBlendMode())
            {
                yield return($"Blend {blendMode.GetShaderBlendMode()}");
            }
        }