Skip to content

Commit

Permalink
tidied up the punch through alpha of SimpleShaderAppearance
Browse files Browse the repository at this point in the history
  • Loading branch information
philjord committed Jul 16, 2023
1 parent 30e1777 commit 037fae3
Showing 1 changed file with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,23 +168,17 @@ public static void setVersion120() {
"uniform int alphaTestFunction;\n" + //
"uniform float alphaTestValue;\n";

public static String alphaTestMethod = "if(alphaTestEnabled != 0)\n" + //
"{ \n" + //
" if(alphaTestFunction==516)//>\n" + //
" if(baseMap.a<=alphaTestValue)discard;\n" + //
" else if(alphaTestFunction==518)//>=\n" + //
" if(baseMap.a<alphaTestValue)discard;\n" + //
" else if(alphaTestFunction==514)//==\n" + //
" if(baseMap.a!=alphaTestValue)discard;\n" + //
" else if(alphaTestFunction==517)//!=\n" + //
" if(baseMap.a==alphaTestValue)discard;\n" + //
" else if(alphaTestFunction==513)//<\n" + //
" if(baseMap.a>=alphaTestValue)discard;\n" + //
" else if(alphaTestFunction==515)//<=\n" + //
" if(baseMap.a>alphaTestValue)discard;\n" + //
" else if(alphaTestFunction==512)//never \n" + //
" discard; \n" + //
"}\n";
public static String alphaTestMethod = " if(alphaTestEnabled != 0){\r\n"//
+ " if(alphaTestFunction==512)discard;//never (never keep it)\r\n"//
+ " if(alphaTestFunction==513 && !(baseMap.a< alphaTestValue))discard;\r\n"//
+ " if(alphaTestFunction==514 && !(baseMap.a==alphaTestValue))discard;\r\n"//
+ " if(alphaTestFunction==515 && !(baseMap.a<=alphaTestValue))discard;\r\n"//
+ " if(alphaTestFunction==516 && !(baseMap.a> alphaTestValue))discard;\r\n"//
+ " if(alphaTestFunction==517 && !(baseMap.a!=alphaTestValue))discard;\r\n"//
+ " if(alphaTestFunction==518 && !(baseMap.a>=alphaTestValue))discard;\r\n"//
+ " //alphaTestFunction==519//always (always keep it)\r\n"
+ " }";//


public static String glFrontMaterial = "struct material\n" + //
" {\n" + //
Expand Down

0 comments on commit 037fae3

Please sign in to comment.