Rajavanya Subramaniyan
Rajavanya Subramaniyan

Reputation: 2155

How to manipulate pixels of rendered screen or Display Object in Actionscript 3?

My game engine doesn't render into a BitmapData like Flixel/Flashpunk does. Instead it uses the Display list of Flash player internally.

I need to do some post processing, like scan lines, and wobble, glitch etc on the final rendered screen (e.g- http://goo.gl/Enwae). I have done render-to-texture in OpenGL and used a pixel shader used to manipulate the final rendered scene.

How do I implement the equivalent of same in Actionscript 3? I saw the reference for Pixel Bender and Shader Filter classes. Can someone give a simple example or point me to relevant information to the context specified here?

Upvotes: 0

Views: 187

Answers (1)

Cadin
Cadin

Reputation: 4649

I'm pretty sure you'll need to render the screen to BitmapData at some point if you want to manipulate the pixels in that way.

You could try using BitmapData.draw() to render the entire stage to BitmapData, but performance will most likely be miserable unless you're just using it on a fairly static screen (like a menu).

Otherwise you're probably better off with a game engine that blits to a bitmap canvas instead of using the display list.

Upvotes: 0

Related Questions