tutorial


How to optimize your modeling for Cult3D
By Thomas Andersson

Copyright 2001 Cycore,
www.cycore.com

This article describes different methods to optimize the scene that is displayed as a Cult3d object.
The optimizations aim to reduce the file size of the *.co file (to reduce the time it takes to display the scene) and increase the frame rate of the scene played in the Cult3D viewer. If the object is intended for local use only (from a CDROM for example) the file size optimization may not be so important.

 

Modeling
It does'nt matter for Cult3D what technique you use when modeling for Cult3D, use whatever technique you feel comfortable with, but remember that polygoncount and filesize are crucial. Try to keep the amount of polygons as low as possible, both for faster rendering and for smaller files. Personally I like both NURBS and all kinds of spline modeling (patch grids, bevels, extrusions), but I tend to always end up with pure polygon modeling. This to have total control over each face, manual optimization is always the best.

Cult3D rendering engine performs complex clipping operation on objects in order to increase the frame rate. You should take care of not creating large objects that could interfere with that function. A typical case is when the 4 walls of a modelled room are in fact modelled as one single object: by separating the walls, you allow Cult3D to clip the one that is not visible when the camera is in the middle of the room.

 

Phong and Gouraud
The shading of the mesh in Cult3D, can sometimes look a little bit different than 3d Studio MAX's, therefore it can be wise to continously during the progress, export your scene and view the exported preview. This way you can study how many steps in your spline, amount of segments in your primitive you should use. Usualy you'll need less polygons in Cult3D, than in 3d Studio MAX, especially on highly reflective objects if you use the Phong shading.
Highly reflective objects are best rendered with the Phong shading, since Phong calculates the highligh on a pixel level (Gouraud on vertex level), and you will get a more accurate highlight on organic shaped objects. Try though to limit Phong shaded objects to organic objects with sharp highlight, and use Gouraud on hard edged objects. Phong is slightly slower in rendering, so its wise to not overuse it if you want to keep a good frame rate.
If a model has a reflectionmapping, its highlights can be drawn into the reflection map. Doing so will get the highlights while allowing you to still use Gouraud shading.
Sometimes, it may be a better solution to keep more polygons and use the faster Gouraud shading rather than removing the polygons and use the slower Phong shading.

Polygons in the mesh adds to the filesize, but not nearly as much as the textures and the animation. Use hires textures in 3d Studio MAX and resize them when exporting for best quality. Always make sure you export your textures in as small size, and high compression as possible. Do not compress the texture bitmap before mapping the object in 3d Studio MAX, but insert them as uncompressed bitmap (as TIFF, BMP or JPEG files) and compress them later in the Cult3D Exporter with the wavelet codec.
Also re-use your textures within the Cult3D file if possible, same reflection image on every reflective object etc.
A technique I like is to use sub-materials in 3d Studio MAX, and split a large texture into a few smaller. This allows me to set size and compression of each bitmap individually, so I can adjust the compression to what quality is required for exactly that texture. This technique is also useful if you want to du decal mapping, since Cult3D does'nt support it. This can also be used if you have a tileable pattern instead of a color, just make sure that the pattern seamlessly fits to the decal bitmap.

>> Tutorial about Decal Mapping

Do not use textures on the object to get a simple color, since the rendering of the texture is slower than the rendering of the material color. instead, use the material color of the object.

If you have a bump on the material, double check if it is really necessary ;-) If you can do without it, you'll gain a few frames when the scene is played back.
If you have a bump on the material, make sure you have a correct bump map for the logo material, since Cult3D demands that the size and tiling are the same when you have diffuse and bump mapping in the same material.

 

Optimize and polygon reduction
Manual optimization is always best, but the exporter can help you a lot. These two tools that are located in the Cult3D exporter under Nodes/Mesh works in different ways, and are good for different occasions. The Optimize is is very efficient for objects with hard edges, and with lot of flat surfaces. While 3d Studio MAX only works with triangles, Cult3D can use multi-sided polygons. So what optimize do is it takes all triangles lying in the same plane, and create one multisided polygon of them. Polygon reduction is more of a regular polygon reduction tool. It works better on organic shaped objects. Most of the time Optimize and Polygon reduction does'nt work well together, this is pretty obvious if you've read the above…

 

Animation
As with all realtime animations the fewer frames in your animation the better, especially when you're dealing with vertex animations. If possible do your simple animations in the Designer, translations and rotations made in the Designer adds virtually nothing to the filesize at all. The upside of doing the animation in 3d Studio MAX and use animation play, is that you can use the Motion Completion Event, which you can't with translations and rotations. Its very useful when you have something that is happening when the animation is finished. Example: a cardoor closes (animation made in 3d Studio MAX ), and the car drives away. The Motion Completion Event triggers when the doorclosing is finished, and start the drive-away-animation. But as I said, it costs in filesize when using animations from 3d Studio MAX.

 

Animation play and Animation jump to
The difference between these two is that Animation play , plays the animation, frame by frame and Animation jump is more like a morph, where you set target frames. Anim jump to is VERY efficient when you're dealing with vertex animations. What you can do is to animate just a very few frames in 3d Studio MAX (or even only individual keys), and Animation jump to will create keyframes in between. This animation, since created in Cult3D, is much more efficient, and creates much smaller file. Example: a fish swimming. A smart way to do the animation of the swimming, is to just have 3 frames, with the fish's tail at its extreme positions. In the Designer you use a sequence with animation jump to's, to animate between the keyframes. This way you create a smooth vertex animation, but you're only using 3 frames.

 

By Thomas Andersson