We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2638a0d commit 0b44a21Copy full SHA for 0b44a21
h3d/shader/KillAlpha.hx
@@ -8,7 +8,9 @@ class KillAlpha extends hxsl.Shader {
8
var pixelColor : Vec4;
9
10
function fragment() {
11
- if( pixelColor.a < threshold ) discard;
+ // Put the result of the check in a var. This way the DCE can correctly say that only the alpha channel of pixelColor is needed.
12
+ var doDiscard = pixelColor.a < threshold;
13
+ if( doDiscard ) discard;
14
}
15
16
0 commit comments