How do you use the GPU for 3D rendering in an Adobe Air app
I'm playing with Air and trying to get the PaperVision3D engine to display some 3D models.
But its really slow since Air seemingly does not support GPU acceleration. Any开发者_如何学编程 way to enable GPU rendering in air apps? browser apps can use "wmode=gpu" in the HTML settings...
I think you'll need to wait for molehill, http://labs.adobe.com/technologies/flash/molehill/
the current hardware acceleration is pretty limited.
http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3_Flex/WS2E9C7F3B-6A7C-4c5d-8ADD-5B23446FBEEB.html
there is some info at the bottom of the page there
Direct and GPU-compositing window modes
Flash Player 10 introduces two window modes, direct and GPU compositing, which you can enable through the publish settings in the Flash authoring tool. These modes are not supported in AIR. To take advantage of these modes, you must enable hardware acceleration for Flash Player.
Direct mode uses the fastest, most direct path to push graphics to the screen, which is advantageous for video playback.
GPU Compositing uses the graphics processing unit on the video card to accelerate compositing. Video compositing is the process of layering multiple images to create a single video image. When compositing is accelerated with the GPU it can improve the performance of YUV conversion, color correction, rotation or scaling, and blending. YUV conversion refers to the color conversion of composite analog signals, which are used for transmission, to the RGB (red, green, blue) color model that video cameras and displays use. Using the GPU to accelerate compositing reduces the memory and computational demands that are otherwise placed on the CPU. It also results in smoother playback for standard-definition video.
Be cautious in implementing these window modes. Using GPU compositing can be expensive for memory and CPU resources. If some operations (such as blend modes, filtering, clipping or masking) cannot be carried out in the GPU, they are done by the software. Adobe recommends limiting yourself to one SWF file per HTML page when using these modes and you should not enable these modes for banners. The Flash Test Movie facility does not use hardware acceleration but you can use it through the Publish Preview option.
Setting a frame rate in your SWF file that is higher than 60, the maximum screen refresh rate, is useless. Setting the frame rate from 50 through 55 allows for dropped frames, which can occur for various reasons from time to time.
Using direct mode requires Microsoft DirectX 9 with VRAM 128 MB on Windows and OpenGL for Apple Macintosh, Mac OS X v10.2 or higher. GPU compositing requires Microsoft DirectX 9 and Pixel Shader 2.0 support on Windows with 128 MB of VRAM. On Mac OS X and Linux, GPU compositing requires OpenGL 1.5 and several OpenGL extensions (framebuffer object, multitexture, shader objects, shading language, fragment shader).
You can activate direct and gpu acceleration modes on a per-SWF basis through the Flash Publish Settings dialog box, using the Hardware Acceleration menu on the Flash tab. If you choose None, the window mode reverts to default, transparent, or opaque, as specified by the Window Mode setting on the HTML tab.
Also Mike Chambers has some info somewhere about GPU acceleration (look for notes on pewpew), but I think this is all meant for mobile only.
精彩评论