PDA

View Full Version : Pixel Bender, blendShader's flex 3.4 etc.


The Brow
09-18-2009, 07:28 PM
I'm trying to get my feet wet with Pixel Bender in flex/as3 and the way to do that I thought, is with the blendShader or Shader constructs documented in the ADobe 3.4 online language reference. However, I just downloaded the Flex 3.4 API from the adobe devnet, and I get compiler errors from the 3.4 mxmlc compiler just referencing blendShader/shader. Those terms don't even appear to be found anywhere in the .as files that are part of that distribution, which considering its called Flex API 3.4, is something of a mystery.

But getting any sort of help from Adobe, even pursuant to some sort of purchase from them, seems to be a fruitless endeavor (e.g . "Adobe, what product do I need to purchase since shaders/blendShaders don't appear to be in the Flex 3.4 API?")

So anyway, I guess my real question is (for anybody) does anybody have samples of using PixelBender from within AS3/Flex that *don't* make use of shaders? IOW is there something just using bitmapData (for example) as input parameters to a Pixel Bender kernel?

(This is really an AS3 question, too.)

wvxvw
09-18-2009, 08:19 PM
You need to target FlashPlayer 10 for those things to work... SDK 3.2+ should be fine for that... only make sure you're compiling for the right player and you can playback what you compile (i.e. you have a proper version of player installed).

The Brow
09-18-2009, 08:44 PM
wvxvw,

would that be merely a compiler option I need? I actually did a text search of the entire 3.4 distribution for the string "blendShader" and I believe it only showed up in an air.dll. - not in any source files.

Here was the download site for it, where it clearly says "Download Adobe Flex 3.4 SDK"

http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk

(Don't know why its on the cfusion site, but the link to it is from devnet/flex/download or something like that.)

I just mention all this in case you have an inside line there (I notice you're a mod on the adobe langref site.) Because maybe its actually missing from the 3.4 download erroneously.

Unless you're telling me I just need the correct mxmlc compiler option.

Thanks,

The Brow

Peter Cowling
09-18-2009, 08:54 PM
Hi,

I would use the confluence site for sdk (http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code).

EDIT
Nightlies sometime have up to eniture .swc's missing, but I have not seen it in a full point release. I never did use 3.4, but if they did miss it out in the first place, I doubt it is still missing now...

The Brow
09-18-2009, 09:10 PM
Peter Cowling, thanks I just downloaded a zip of the binary distribution for the 3.4 sdk (which includes a lot of source as well) on that site so don't know if that will solve my problem, or if you're implying I somehow I have to build the entire API from source, but anyway I'll check out the site further and thanks for the info.

The Brow
09-18-2009, 09:44 PM
still no luck with the download from that confluence site.

Just trying to add the following to my source:

import flash.display.Shader;

results in the following compiler error:

Definition flash.display:Shader could not be found.

generated by the following compile command:

mxmlc -use-network=FALSE -actionscript-file-encoding=UTF-8 -compiler.source-path=. back38_12\test.mxml

(fwiw)

The Brow
09-18-2009, 10:05 PM
Alright it looks like you have to modify flex-config.xml, but I don't undertstand why the string "shader" itself could not be found in the entire distribution.

wvxvw
09-18-2009, 11:46 PM
Well, that's a built-in class, why would someone mention it in the custom AS classes if he doesn't ever uses it?
I think that for targeting the FP10 you will both need to modify the configuration file to have <target-player>10.0.0</target-player>
this line in it. Besides, make sure that the playerglobals.swc that you have linked to the project is the one you need (i.e. if you open it with Zip you will find there the mention of Vector class or Shader for that case).
Somehow I always used to get SDKs configured by default to target FP10 :) and needed to do exactly the opposite - taget the FP9 :) However, I think I've came across a few issues, where the downloaded SDK was targeting the 9th player by default.

The Brow
09-19-2009, 12:08 AM
wvxvw:

Here's the specific instructions they give for targetting flash player 10 (http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10).

Well next on the agenda is going to be getting a blendShader to work with three input bitmaps: the standard background, the display object assigned the blendShader, and then an additional bitmapdata also passed into the pixel bender kernel and utilized in the calculations. The thing I'm uncertain about is, does this additional bitmap have to be as large as the maximum size of the browser. Well, just in case you had access to sample code in this area, as I haven't written anything yet . (A tall order I guess - thanks for the other info regardless.)

The Brow

wvxvw
09-19-2009, 12:28 AM
I had never really used it, but this should get you started..
http://www.actionscript.org/resources/articles/876/1/Introduction-to-Pixel-Bender-and-Shader-for-Flash-Player-10/Page1.html