What does this fragment shader line do?
if (tex.a < 0.5) discard;
- Blends the pixel at half alpha
- Deletes the texture from memory
- Skips the whole draw call
- Drops pixels below the cutoff
This is alpha testing (cutout): discard writes nothing for that fragment, giving hard-edged foliage or fences without sorting for blending.
Play Game Dev ▸