Created
December 12, 2012 14:53
-
-
Save katopz/4268356 to your computer and use it in GitHub Desktop.
Stage3D kil opcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
refer to : http://www.kirupa.com/forum/showthread.php?374071-stage3d-AGAL-how-to-use-the-kil-opcode | |
AGAL: | |
[ | |
"tex ft0, v0, fs0 <2d,clamp," + TextureSmoothing.NONE + ">", //store texture in ft0 | |
"sub ft1.x ft0.a fc0.x", //store alpha - threshold (fc0.x) in temp ft.x | |
"kil ft1.x", //kill based on that | |
"mov oc, ft0" // move to output colour | |
] | |
// fragment shader specifying a threshold: | |
var myAlphaPoint:Number = .01 | |
var myThreshold:Vector.<Number> = new <Number>[myAlphaPoint,myAlphaPoint,myAlphaPoint,myAlphaPoin t] | |
context.setProgramConstantsFromVector( Context3DProgramType.FRAGMENT, 0,myThreshold) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment