Here's a couple tricks:
Modeling - Less vertices/faces will process faster - Not all formats are alike. Some are more efficient or accurate than others Texturing - Simpler textures strain Flash less - Complex graphics like transparency or large graphics can take a toll in performance - Models set to have textures on only one side of each face tend to render better than double-sided models Rendering - The simple renderer works faster than the advanced z-sort or intersecting renderers - Don't be afraid to switch renderers on-the-fly in order to best balance between performance and visual quality - Don't render on every frame. Render only when necessary - Make use of 2D UI or other tricks to provide functionality without rendering the 3D scene again - When necessary, push objects to their own View, so they can be rendered separately from the rest of your objects Physics/Etc - If you need physics, see if it can be done with 2D physics. It will perform faster, and may be easier/more powerful to implement - It's also okay to use 3D layers like 2D graphics sometimes. Render it, then move it in 2D I worked on a large project, which required drag-and-drop support for many objects. These are the main tools I used to improve my performance: - I used a fast renderer when panning the camera, then processed a single render of a higher quality renderer once the camera stopped moving - I only allow dragging of one object at once, and push it to its own layer, so no matter how many objects are on-screen, Away3D only needs to constantly render one object at a time while dragging, which was necessary for performance - I used 2D physics - I sometimes used a 2D object or a simple 3D object for dragging, then swapped it for the full-quality object when finished - I set the models to single-sided and exported from Maya using the OpenCollada plugin - I process many textures at run-time, as I had 30+ objects with 15 or so texture styles. Each object had a transparent overlay which I baked together which the base for each texture style in order to create the texture I needed for each object at any given time - I apply a generally fast tween when panning the camera in order to hide visual glitches from the fast renderer and in order to demand less frames from the engine. This also prevents the user (usually) from dragging while the camera is moving, which can drain performance - The background is also in its own layer, which is hardly ever rendered. In all, I use three layers: background, objects, and current dragging object I think that many of these techniques may come in handy for optimizing performance for a chess game On Mon, 03 May 2010 08:17:20 -0700, manno <[email protected]> wrote:
Hi all, [sorry, but pretty much a noob at 3d programming, insight in needed mesh count for good looking models and lighting / texture options] I'm busy with a playable version of a chess variation. Chessboard and 40 (yes 40, not 32) pieces. Chessboard is 64 separate planes to allow for individual highlighting and another plane for the margins of the board. Chesspieces were collada but I've converted them to AS3 objects with preFab. All pieces are made up from the 6 piece Classes. At the moment with a ColorMaterial only. Vertice count of the pieces varies from 287 to 419, face count from 404 to 764. They were provided. The scene totals in a whopping 23+K elements (t elements as stated in Stats) and framerate grinds to a halt... Never mind a PhongShader. Now, I've seen visually more complex scenes like: http://www.infiniteturtles.co.uk/projects/away3d/demos/FrustumHotelRoom/Advanced_FrustumHotelRoom.html Which perform OK and have a mere fraction of elements to render from what I have. Can anyone advice on a path to take to get at least some performance? Willing to spend time ofcourse, but just stuck not knowing where to look :( I thought about using billboards with prerendered bitmaps for the pieces, but the BillBoard class seems to have been dropped from the latest version(?) No mention of it in the docs, and nowhere to be found in the classes. Thanks in advance, Manno Bult
