0

Let's say I was building a game, and had some tilemaps to create the world in several layers. The view would be orthographic, basically just a top-down view of the world.

I'm thinking of using Depth-Test to compare which sprites gets drawn from top to bottom (layer-wise). (Note: I'm aware this may not be the best approach to this problem, but humor me...)

If I have some character sprites with fully transparent edges (either a keyed-color or zero alpha around the sprite), can I use the 'kil' opcode in the fragment-shader when that's encountered to make sure the Quad doesn't present a "hole" in the transparent parts of the sprite? (at least that's what I'm assuming would happen).

I guess a more simple question to this is.... does 'kil' ignore that pixel and simply leaves whatever pixel color was there before / in the last drawTriangles() call?

chamberlainpi
  • 4,854
  • 8
  • 32
  • 63

1 Answers1

0

kil completely discards the fragment, so that means no color, stencil or depth writes.

Gray
  • 2,333
  • 1
  • 19
  • 24