Skip to content

Commit 037fae3

Browse files
committed
tidied up the punch through alpha of SimpleShaderAppearance
1 parent 30e1777 commit 037fae3

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

src/main/java/org/jogamp/java3d/utils/shader/SimpleShaderAppearance.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -168,23 +168,17 @@ public static void setVersion120() {
168168
"uniform int alphaTestFunction;\n" + //
169169
"uniform float alphaTestValue;\n";
170170

171-
public static String alphaTestMethod = "if(alphaTestEnabled != 0)\n" + //
172-
"{ \n" + //
173-
" if(alphaTestFunction==516)//>\n" + //
174-
" if(baseMap.a<=alphaTestValue)discard;\n" + //
175-
" else if(alphaTestFunction==518)//>=\n" + //
176-
" if(baseMap.a<alphaTestValue)discard;\n" + //
177-
" else if(alphaTestFunction==514)//==\n" + //
178-
" if(baseMap.a!=alphaTestValue)discard;\n" + //
179-
" else if(alphaTestFunction==517)//!=\n" + //
180-
" if(baseMap.a==alphaTestValue)discard;\n" + //
181-
" else if(alphaTestFunction==513)//<\n" + //
182-
" if(baseMap.a>=alphaTestValue)discard;\n" + //
183-
" else if(alphaTestFunction==515)//<=\n" + //
184-
" if(baseMap.a>alphaTestValue)discard;\n" + //
185-
" else if(alphaTestFunction==512)//never \n" + //
186-
" discard; \n" + //
187-
"}\n";
171+
public static String alphaTestMethod = " if(alphaTestEnabled != 0){\r\n"//
172+
+ " if(alphaTestFunction==512)discard;//never (never keep it)\r\n"//
173+
+ " if(alphaTestFunction==513 && !(baseMap.a< alphaTestValue))discard;\r\n"//
174+
+ " if(alphaTestFunction==514 && !(baseMap.a==alphaTestValue))discard;\r\n"//
175+
+ " if(alphaTestFunction==515 && !(baseMap.a<=alphaTestValue))discard;\r\n"//
176+
+ " if(alphaTestFunction==516 && !(baseMap.a> alphaTestValue))discard;\r\n"//
177+
+ " if(alphaTestFunction==517 && !(baseMap.a!=alphaTestValue))discard;\r\n"//
178+
+ " if(alphaTestFunction==518 && !(baseMap.a>=alphaTestValue))discard;\r\n"//
179+
+ " //alphaTestFunction==519//always (always keep it)\r\n"
180+
+ " }";//
181+
188182

189183
public static String glFrontMaterial = "struct material\n" + //
190184
" {\n" + //

0 commit comments

Comments
 (0)