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); }
//=================================================================== public Material SetAlphaTest(AlphaTestType type, float alpha) { this.alphaTest = type; this.alphaTestValue = alpha; return(this); }