Adobe Pixel Bender Effects – Solar Frame Shader

Introduction

Welcome to another tutorial on Pixel Bender Shaders. In this tutorial we will create a solar like image frame. The shader allows us to specify frame center, size, background color, number and length of sun beams. It also allows us the shift and adjust the input image.

Adobe Pixel Bender

If you want to write an image shader for your Flex or Flash application it is recommended that you install Adobe Pixel Bender Toolkit. It includes the Pixel Bender kernel language and graph language, the Pixel Bender Toolkit IDE, sample filters, and documentation needed for developing and debugging shaders. Once you finish developing your shader you can export the binary code and use it in a regular Flex/Flash application.

Solar Frame Shader

The idea is to use an appropriate polar graph. Polar graphs use a radius and an angle (r, theta) instead of (x, y). The relation between (x, y) and (r, theta) can be related using the sin and cos of the angle. Take a look at the code below:

Live Demo

In order to use the shader above in a Flex/Flash application you need to compile and export the shader using Pixel Bender Toolkit mentioned earlier. Here is the shader in action. Try to play with it to get a feeling of what it does.

[kml_flashembed movie=”https://www.8bitavenue.com/wp-content/uploads/2012/05/pixel_bender_solar_frame.swf” height=”450″ width=”550″ /]

Flex Source Code

You can download the full Flex source code here. Thanks for reading.

Add a Comment

Your email address will not be published. Required fields are marked *