Actionscript 3:有什么方法可以从本地程序获取数据或从本地程序获取数据吗?
我最近正在构建一个像素着色器,以将着色应用到我当前正在编写的 Flash 游戏中的玩家角色。然而,事实证明,Actionscript 3 ……没有很好地处理这个问题,而且帧率的影响相当大。
我想做的是用 C++ 编写一些东西,然后可以使用 OpenGL 缓冲区来存储我想要调整的像素,以硬件加速方式调整它们,然后将其传递回 Flash 文件。
有没有办法让 AS3 将位图数据传递到本地着色器插件 .exe,然后接受返回的数据,或者我应该放弃并在 Unity 中重写整个该死的东西?
如果做不到这一点,有什么方法可以强制 GPU 在 AS3 中进行数字运算吗?我知道 OpenGL 不能与 AS3 一起使用,但是 DirectDraw 可能吗?
我知道整个企业a)荒谬的矫枉过正,b)可能注定要失败,但目前这一切都阻止了我为该项目撰写反思性论文。 (大学课程)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法与任何本地程序交互。从 Flash Player 10 开始,出现了一些愚蠢的硬件加速支持,但主要是针对视频而不是 3D。 AS3 (Flash Player 10+) 可以提供的最好功能是对在 3D 中处理三角形的本机支持(drawTriangles() 方法)。例如Flash 3D引擎“Away3D Lite”就使用了这个功能。
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.
你试过看炼金术吗?
http://labs.adobe.com/technologies/alchemy/
这是一种编译方式C++ 代码转换为 swf 字节码。
Have you tried looking at Alchemy?
http://labs.adobe.com/technologies/alchemy/
It is a way of compiling C++ code into the swf bytecode.