Question

I've recently been constructing a pixel shader to apply shading to the player-character in a Flash game I'm currently coding for. As it turns out, however, Actionscript 3 is... Not handling this gracefully, and the framerate hit is pretty huge.

What I would like to do is write something in C++ that can then use OpenGL buffers to store the pixels I want to tweak, tweak them in a hardware accelerated fashion, and then pass it back to the Flash file.

Is there any way of getting AS3 to pass bitmap data to a local shader plugin .exe, and then accept returned data back, or should I just give up and rewrite the entire damn thing in Unity or something?

Failing this, is there any way of forcing the GPU to do the number crunching in AS3? I know OpenGL can't be used with AS3, but DirectDraw, perhaps?

I'm aware this entire enterprise is a) ridiculous overkill and b) probably doomed, but it's currently all that's preventing me from having to work on my reflective essay for the project. (University coursework)

Was it helpful?

Solution

You can't interact with any local program. Since Flash Player 10, there is some silly hardware acceleration support, but mostly for video and not for 3D. The best AS3 (Flash Player 10+) can provide is the native support for working with triangles in 3D (method drawTriangles()). For example Flash 3D engine "Away3D Lite" uses this feature.

OTHER TIPS

Have you tried looking at Alchemy?

http://labs.adobe.com/technologies/alchemy/

It is a way of compiling C++ code into the swf bytecode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top