# stage3d/AGAL - how to use the kil opcode

**URL:** <https://forum.kirupa.com/t/stage3d-agal-how-to-use-the-kil-opcode/329078>\
**Category:** flash\
**Created:** [July 18, 2012, 11:11am UTC](https://forum.kirupa.com/t/stage3d-agal-how-to-use-the-kil-opcode/329078 "2012-07-18T11:11:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumprock](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jumprock](https://forum.kirupa.com/u/jumprock)\
**Post date:** [July 18, 2012, 11:11am UTC](https://forum.kirupa.com/t/stage3d-agal-how-to-use-the-kil-opcode/329078/1 "2012-07-18T11:11:21Z")

</div>

HI, I’ve been trying to find some examples of how to use the kil opcode for hours but there is very little out there.

I am making a 2D game using stage3D (not using starling) and I want to use kil to prevent transparent pixels from being rendered.

My fragment shader currently has this AGAL code:

“tex oc, v0, fs0 \<2d,clamp,”+TextureSmoothing.NONE+"\>"

How do I incorporate kil to discard any transparent pixels in the texture? And is there a way to specify the threshold?

Hoping there is some help out there!
