Back to Content
3. Flash (.swf) Target
When creating Flash applications with CopperCube, and the setting 'Use Old Flash player rendering', there are several things to consider: The Flash platform (at least in its version 9 and 10) is not designed to do high speed 3D rendering, and although the CopperCube flash engine is designed to maximize the rendering speed, there are some limitations: Depending on your the target system, you can only use a very limited amount of polygons per scene. For average systems, this is usually a value at 300 - 500 polygons, but you are able to increase this value depending on the type of the scene, the materials and more.
Note: All this doesn't apply to the new flash renderer introduced in CopperCube 3, which uses Stage 3D.
3.1 Z-Ordering Issues
The old, non-Stage3D Flash environment (Flash Player 10 and earlier) does not support a Z-Buffer as needed by modern 3D engines, so at some special places in your scene, Z-Ordering problems may occur, like here:
A Z-Order Issue.
There are several ways to remove or reduce such problems:
Solution 1: Split huge polygons into smaller ones
The reason for these Z-Order problems is usually that there is a huge polgon behind a smaller one, and the engine is not able to decide correctly in which order to render the polygons. The improve this situation, simply split up the huge polygon into smaller ones.
Solution 2: Remove overlapping polygons
Model your 3d geometry to remove overlapping polygons. Like in this example here:
The column is overlapped by the huge rectangle polygon.
Instead try to model it in this way:
Better: no overlapping anymore.
3.2 Performance tips
The old, non-Stage3D Flash environment (when using the 'Use Old Flash player rendering') wasn't orignally designed to render 3D graphics, so the performance of it is of course not as good as the default one. In comparison to when using the Flash Player 11 features, the performance of these 3D graphics in Flash is actually pretty poor. Here are some tips to improve the performance of your 3D scene:
- Use low resolution textures: If you can live with a texture of size 128x128 instead of one with 1024x1024 pixels, then use the smaller one.
- The average amount of polygons for a flash 3D scene is not very high. Reduce the amount of polygons in your scene if you can. Don't model background walls or parts in the scene which cannot be seen anyway.
- If your 3D modelling package supports baking lightmaps into textures, use this feature instead of the CopperCube built-in lightmapper. It could give you a slight performance boost when the CopperCube flash renderer only has to render one texture layer instead of two.
- In the 'publishing settings' dialog on the flash tab, you can specify when the flash player should update the scene. Set it to 'only
when camera moved', if this is sufficient for your scene.
3.3 Scripting with Actionscript 3
You can make your CopperCube 3D flash scenes more interactive using ActionScript 3.
There is a comprehensive AS3 scripting reference available in this documentation.
There is also a full example available: Movement with Actionscript 3.