(release 1.4)
Copyright 2008-2013 Nine Vectors.
All Right Reserverd. http://ninevectors.ortosoft.eu

SWF publishing, optimization

The output product is a file in SWF format, which you can embed on the : website, desktop applications, applications for mobile devices and basically anywhere where, flash player in version at least 11 is installed. The output file of Esquimo has its own engine, thanks to which it is possible to generate files of small sizes. Since 1.3 version most of optimization issues are outdated. Some scene settings might affect GPU load but not as much and major of present graphics card handles playing SWF based on Molehill with no problems

Let's look at basic scene settings:

General
Width, Height - specifies the output file size in pixels.
Antialiasing - specifies the level of smoothing edges. There are 3 available types: Minimal, High, Very High. In most cases "Minimal" is enough to achieve desired effect.
Use buttons below to see samples of available antialiasing modes:
Disabled Minimal High Very high

Ambient color - the color that is taken by non-lighted surfaces.
Background color - the color that is behind all drawn objects. You can specify default value in options panel. Read more about setting background color for SWF and editor here.


Advanced
Offset X, Offset Y - the distance from upper left corner of movie clip (stage of Esquimo SWF) to the Stage3D which is a base for scene rendering. It comes handy when you want to add some frame with alpha channel around the Esquimo animation. Read more below.
Near Z, Far Z - a visible part of scene that starts at Near Z and ends at Far Z measured as a distance from camera. Objects out of boundary values are cutted out. The less amount between Near Z and Far Z the better precision is used in Z-buffer calculations.
Enable resizing - used when you expect your Esquimo movie resizing on the website or you want to your Esquimo movie resizing so that it fits the browser window size. When the options is checked you can also resize the preview window.


Frames control
Frames per second - The number of frames played per second. The more frames are played, the more smooth is the animation, but at the same time it load CPU more. If the power of processor is not sufficient to play at too high value of Frames per second (FPS), then its value is reduced during the playback by the engine. When generated animation is loaded into another SWF object, which becomes its parent, the FPS of loaded animation is reduced to the FPS its parent.
Total frames - length of animation in frames.
Play after load - if this option is selected (by default), SWF begins to play immediately after being loaded. Deselecting of checkbox will cause the animation to play only when the SWF object receives an external command of start from application - parrent movieclip. For more information see the chapter Esquimo API.
Loop play - After playing the last frame, the animation jumps to the first frame and then it starts playing scene again. If this option is unselected, the animation will be played only 1 time and stops at the last frame.
Play on mouse over - Animation is played only when there is a mouse cursor over it.


In software renderer edition of Esquimo (last software renderer version - 1.2) there was parameter Transparent background which has been taken out in Molehill version becasue of its way of Stage drawing. It enables to achieve few interesting effects that can not be accomplished with Molehill version. Check the examples below:

Example 1 This example shows the use of transparent background in SWF with Transparent background turned on over HTML content. Of course, you need to remember to set "wmode" parameter to "transparent".
Example 2 In this example, the animation created in Esquimo is one of the layers of the whole animation. In the accompanying example, it is layer #3, indescribable by the text. In this example, the SWF file generated in Esquimo was loaded dynamically using AS3.
(Click on the animation to turn it off).
Example 3 In this example the animation also has been loaded dynamically. You can see here, that thanks of transparent background Esquimo object might be processed with AS3 as a typical DisplayObject. The example shows the change of transparency level, use of blend modes, filters (here Drop Shadow, Glow - Inner, Outer, Knockout ) and also use of Esquimo object as a mask. In mask mode both the Esquimo objects and masked object must set cacheAsBitmap = true;

Rendering region

Aspect ratio of work area windows usually differs from the one resulted from width and height of output file. That is why the workspace area doesn't overlap with published SWF's area. By default the option of render region preview is turned on (Tools->Options, ALT+O).

Rendered area boundaries are visible only when scene ascpect ratio (resulted from "Scene" tab, General settings) is lower than ascpect ratio of work area window. Otherwise the rendered area boundaries will not be visible ( they come out of the work area window ). Compare these 2 cases on the figures below:

Optimization

In version 1.3 of Esquimo we moved most of CPU hungry parts of code to GPU.  Filling surfaces, drawing lines, collision detection, lightning are now calculated by GPU what reduce usage of CPU to very low levels. At this stage there is nothing to worry about in terms of optimization.  Of course graphics card are not equally powerful and if you want to be sure your animation is displaying at the same speed on several machines pay more attention on building your scene (reduce unnecessary triangles or lights, stay with Minimal antialiasing or disable it...)  and test it on possible slow graphics card.