KillAlpha.hx 318 B

1234567891011121314151617181920
  1. package h3d.shader;
  2. class KillAlpha extends hxsl.Shader {
  3. static var SRC = {
  4. @param var threshold : Float;
  5. var pixelColor : Vec4;
  6. function fragment() {
  7. if( pixelColor.a < threshold ) discard;
  8. }
  9. }
  10. public function new(threshold = 0.) {
  11. super();
  12. this.threshold = threshold;
  13. }
  14. }