Accessibility

TechNote

Optimizing file size, performance and streaming of 3D content

Below are some tips for optimizing file size, performance, and streaming of Director 3D content.

Using Stretch
If you are publishing a movie in Shockwave format, it's a good idea to allow the user to "stretch" the movie to a larger or smaller size to optimize performance. To enable this feature,open the Publish Settings dialog and select the "Fill Browser Window" HTML template on the Formats tab, or experiment with the "Stretch Style" settings on the Shockwave tab.

Optimizing for size and performance

1 Do not use textures unless necessary.
2 Remove geometry not seen by user.
3

Avoid using textures with an alpha channel, as they are expensive for VRAM (textures need to be 32-bit to achieve a smooth 8-bit gradient), and may render more slowly than normal textures.

4 Reduce geometry on primitives, both imported and lingo-generated; for example, reduce the length-, width-, and height vertices for primitives like boxes or planes to the bare minimum of 2, if possible.
5

Reduce polygon count in imported models (especially spheres), or by using LOD in Director.

6 Reduce the polygon count for 3D text by adjusting the smoothness property.

Optimizing for performance

1 Avoid unnecessary layering when authoring 3D models. Doing so will also optimize file size if additional textures are used.
2 Reduce the dimensions of 3D sprites to improve rendering performance, especially for software rendering.
3

Reduce the 3D volume of visible sprites being rendered, at any time, by tweaking thehitherandyonclipping distances. For example, reduce thecamera.yonvalue to prevent rendering of objects far in the distance.

4

Decrease lighting. Try to accomplish the same effect with fewer lights.

5 Experiment with level of detail: tweak thelod.biasand otherlodsettings, or manually adjust thelodlevel.

Note:CPU speed is decisive for software rendering, collisions and composing of several textures in different layers, whereas normal 3D rendering relies more on the graphics adapter throughput capabilities.

Optimizing for size

1 Reduce the size of textures (use 256x256). This also saves VRAM.
2 Reduce the quality of textures.
3

When creating textures from Director cast members, reduce the bit depth instead of using JPEG compression.

4 Tile small textures wherever possible instead of using large textures.
5

Use dynamically created Lingo primitives whenever possible.

6 Instance / clone small geometry to build up complex worlds. This can be done either at 3D modeling time (in a 3D authoring program, for example) or dynamically using Lingo at runtime.
7 Keep building block models and motions in separate externally linked cast member and load them in and usecloneModelFromCastmemberorcloneMotionFromCastmemberas needed.
8 Uncheck the "Enable SDS/Toon" option in the Exporter Options Dialog if you aren't using SDS or Toon. This will improve the compression. Also try adjusting the geometry and motion compression settings.
9 If file size of the movie itself is of concern, also optimize the size of sound members.

Streaming tips

1

Check to make sure all media is available before executing Lingo commands on that media, including externally linked 3D cast members and W3D files loaded with theloadfilecommand.

To perform the check, use thestateproperty, which indicates when a 3D model is loaded (state4 means loaded). Remember to check the state in anexitFramehandler, not a repeat loop. You can also use the traditional means of checking that media is available on 3D members:mediaReadyandframeReady.

2 If you are usingloadfile, you must wait for oneloadfilecommand to complete (that is, get to state 4) before starting the next one.
3

3D models may use other cast member as textures. If so, check themediaReadyproperty and preload those cast members into memory before using them as sources for textures.

4 Reduce your geometry until it has chunky edges, and then add the sds modifierto that model at runtime using Lingo to smooth the edges back out. This may require some tweaking to get the look you want, however.
5

Make use ofloadFile. Make the initial download small and add models as you need them. For instance, you can play some introductory music and display a loading dialog while youloadFile()in your world components. You could stream in level 2 while playing level 1.

6

Specify "load priority" of your models and associated textures in your 3D modeling program for more accurate control over streaming. Some modeling programs allow you to specify per model userData keys to control streaming. (Consult your 3D exporter's documentation for details on this.)You can specify whether you want certain models to be in the initial load segment (that is, fully loaded before member("3d").state = 3), as well as ordering within the file for an individual model's geometry and texture data.

7 A quick-and-easy solution is to un-set the play-while-streaming property under Modify > Movie > Playback. This will prevent problems caused when commands likenewTexture,cloneMotionFromCastmember, andcloneModelFromCastmemberrefer to cast members that are not yet loaded.


AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_15286

Products Affected: