This is a very quick testbed designed to help write Flash AGAL shaders.
If you don’t know what a shader is you should read my Shader Post.
[swf src=”http://northwaygames.com/wp-content/uploads/ShaderTest.swf” params=”wmode=direct” version=11 width=600 height=600]You must have Flash 11 for this to work[/swf]
You can test it out by pasting in my “swaying grass” pixel shader:
sub ft3, v1.y, fc1.y //offset = 1-y pow ft3, ft3, fc2 //offset = offset^3 mul ft3, ft3.y, fc3 //offset = sin(count)*offset mul ft3, ft3, fc4 //offset *= .3 add ft2, v1, ft3 //texturePos.x += offset tex ft1, ft2, fs0 <2d,linear,repeat,mipnearest> //pixel = texture(texturePos) mov oc, ft1 //return(pixel)
If you replace the Pixel/Fragment shader with the above code and hit the “Render” button you’ll see the grass sway. See my Pixel Shader Example post for a full description of this AGAL code.
The (hastily written) source is here: ShaderTestBed.
And you can download the .swf Here.
Leave a Reply