13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 15: Working with Pixel B<strong>en</strong>der<br />

shaders<br />

Flash Player 10 and later, Adobe AIR 1.5 and later<br />

Adobe Pixel B<strong>en</strong>der Toolkit allows developers to write shaders that create graphical effects and perform other image<br />

and data processing. The Pixel B<strong>en</strong>der bytecode can be executed in ActionScript to apply the effect to image data or<br />

visual cont<strong>en</strong>t. Using Pixel B<strong>en</strong>der shaders in ActionScript gives you the capability to create custom visual effects and<br />

perform data processing beyond the built-in capabilities in ActionScript.<br />

Note: Pixel B<strong>en</strong>der support is available starting in Flash Player 10 and Adobe AIR 1.5. Pixel B<strong>en</strong>der bl<strong>en</strong>ds, filters, and<br />

fills are not supported under GPU r<strong>en</strong>dering.<br />

More Help topics<br />

Adobe Pixel B<strong>en</strong>der Technology C<strong>en</strong>ter<br />

Pixel B<strong>en</strong>der Developer's <strong>Guide</strong><br />

Pixel B<strong>en</strong>der Refer<strong>en</strong>ce<br />

flash.display.Shader<br />

flash.filters.ShaderFilter<br />

Pixel B<strong>en</strong>der basics for Flash<br />

Pixel B<strong>en</strong>der basics for Flex<br />

Basics of Pixel B<strong>en</strong>der shaders<br />

Flash Player 10 and later, Adobe AIR 1.5 and later<br />

Adobe Pixel B<strong>en</strong>der is a programming language that is used to create or manipulate image cont<strong>en</strong>t. Using Pixel B<strong>en</strong>der<br />

you create a kernel, also known as a shader. The shader defines a single function that executes on each of the pixels of<br />

an image individually. The result of each call to the function is the output color at that pixel coordinate in the image.<br />

Input images and parameter values can be specified to customize the operation. In a single execution of a shader, input<br />

and parameter values are constant. The only thing that varies is the coordinate of the pixel whose color is the result of<br />

the function call.<br />

Where possible, the shader function is called for multiple output pixel coordinates in parallel. This improves shader<br />

performance and can provide high-performance processing.<br />

In ActionScript, three types of effects can be easily created using a shader:<br />

drawing fill<br />

bl<strong>en</strong>d mode<br />

filter<br />

Last updated 6/6/2012<br />

300

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!