Pixel bender shaders with multiple outputs in flash?
Asked Answered
M

1

7

According to the pixel bender specs a shader can have one or more outputs. The pixel bender toolkit, whose "export to flash" option tends to be preety strict about the flash specific do's and dont's, would even compile such a shader without complaints.

However actionscript's shader related classes seem to be geared toward single output shaders. Is there any way to have multiple shader outputs in flash?

Moonscape answered 30/3, 2010 at 0:58 Comment(0)
S
3

There are some workarounds, listed from easiest to hardest.

1) Use different channels (if you have grey-scale outputs)

2) Double the output width, then do copyRect on the bitmapData to separate them. (assuming that's what you're using)

3) I haven't tried this yet, but it shows some promise, and is the closest to what you want: Use pixel bender assembler to specify two outputs. More info is here: http://www.adobe.com/devnet/flex/articles/flashbuilder4_pixelbender_06.html http://www.ncannasse.fr/projects/pbj (Haxe-specific, but has useful general info)

Swindle answered 31/3, 2010 at 23:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.