OGRE (Object-Oriented Graphics Rendering Engine)

Tutorial 1 - Overview
The 3ds2oof Utility

 

THIS FEATURE IS NOW DEPRECATED

Whilst you can still use this facility, we recommend you use the dedicated exporters from now on since they support more features such as skeletal animation.

 

The 3ds2oof Utility

The 3ds2oof utility is designed to extract geometry information from a 3D Studio (.3ds) object file into a custom file format designed for loading into OGRE, which I have named OOF (OGRE Object Format). These object files can then be loaded in as Mesh objects.

I chose the 3DS format since it's one of the most popular formats, and there are conversions available to it from most other formats. I chose to provide a conversion tool rather than directly loading 3DS in OGRE, because I wanted a bit more control over the format loaded at runtime - the 3DS format is fine in some ways, but for a realtime
engine there's plenty of extras that you typically want - like splitting the geometry down into chunks suitable for submission to the pipeline, extra pre-calculable information like bounding boxes, level-of-detail reductions, etc.

This conversion tool is not all my own work - I used code written by Matthew Fairfax for his OpenGL engine as a starting point for loading the raw 3DS data, although I have made considerable enhancements of my own.

Usage

3ds2oof filename [-vn] [-tc] [-tn] [-vc] [-oObjectName] [-lnnn] [-snnn] [-extExtension] [-matnames] [-usecolours]

The parameters are:

Parameter
Mandatory?
Description
filename
Yes
The name of the 3DS file to read from.
-vn

No

Excluded vertex normals from the output file even if they are present in the 3DS file (e.g. if you are doing your own lighting)
-tc
No
Excludes texture co-ordinates from the output file.
-tn
No
Excludes texture names from the output model.You may wish to use this if you don't intend to use the same textures in OGRE as have been used in 3DS.
-vc
No
Excludes vertex colours from the output model.
-o<Name>
No
Outputs just the named object, if there are multiple objects in the original 3DS file.
-s<NNN>
No
Sets the percentage vertex limit above which a material group will use the shared vertex pool to NNN. (Default 100%). See below.
-ext<EXT>
No
Sets the extension of all texture maps in the model to EXT. Useful if your 3ds file uses one type of graphics file but you wish to use
a different one (I use this to convert BMP references to PNG or JPG). You obviously need to convert your graphics files too.
-matnames
No
Causes the utility to prompt you for new names for the materials defined in the 3DS file. You will be asked for a new name for each; you can enter nothing to leave the name unchanged.
-usecolours
No
Causes 3ds2oof to use the material colours stored in the 3DS file to tint the various parts of the model. Not normally recommended, so turned off by default, since most 3DS models designed for texturing use colours only to indicate groups of items (so they tend to be garish). If your model uses material colours properly, then use this option.

Shared and dedicated vertex buffers

When rendering parts of a model which use different materials, separate rendering calls have to be made with each material setting. When this call is made, a face list is passed which references vertices in a list. This vertex list can either just include the vertices required for this set of faces (dedicated), or may share a buffer of vertices with other parts of the model which use different materials.

If the face list for one material is very small, using a small percentage of the shared vertex list, it is wasteful to pass all the models vertices just to render a small set of faces. Therefore 3ds2oof has a parameter to allow you to specify how much of the overall vertex list a material group must use before sharing vertices; it defaults to -s100 i.e. share vertices only where the material uses 100% of the vertices in the model.

You can save memory (for multi-material objects) by reducing this number at the expense of slightly less efficient rendering calls. Also if you decide to use vertex buffers for rendering an object, you could set -s0 to use a shared buffer for everything, allowing it to be put in the hardware's vertex buffer for efficient processing (NB using vertex buffers in OGRE is not yet supported but is upcoming).

File Format

See 3ds2oof\OgreOOfFile.h for details.

Back to Index << Previous sectionNext section >>