[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 5.2 Some Tips for Efficient Maps

Written by Jorrit Tyberghein, jorrit.tyberghein@gmail.com.

In How to Create Optimal Maps for Crystal Space we talked about large scale optimizations on maps by using the right visibility culler, packing textures, combining objects, using the correct types of object, and lighting considerations. In this section we will mention a few other smaller ticks and trips that can be used to speed up map loading and also performance at runtime.

### Binary Alpha

See Alpha and Keycolor in Textures for a discussion on how to use binary alpha (when only 0% or 100% transparency is required) to improve render speed.

### Efficient Texture Sizes

Your textures should have optimal sizes to improve loading speed. See Efficient Textures for an explanation of this.

### Use DDS Image Format

The DDS image format loads a lot faster. See Efficient Textures for more information about DDS and how to use it.

### Binary XML

If you convert your maps to binary XML you can get considerable map loading improvements. See Binary XML for more information on how to convert your maps and use this feature in general.

### Maximum Object Render Distance

If you have some expensive object or a portal and you know that that object is either no longer visible after some distance (due to other objects blocking it) or else too small to be really relevant then you can use the ``maxrenderdist'` tag in XML to specify the maximum distance to the camera. If the object goes beyond that distance it will no longer be rendered. Here is an example:

    <meshobj name="complextree">
      <params>
        ...
      </params>
      <maxrenderdist value="100" />
      ...
    </meshobj>

This will cause the object to disappear after 100 units. You can also use a variable instead of a hardcoded value (using the ``var'` attribute). In that case you can control the distance at runtime.

This technique is especially useful for portals.

### Far Plane Clipping

You can also do this object removal for all objects at once using far plane clipping. Here is an example:

    <world>
      ...
      <start>
        ...
        <farplane a="0" b="0" c="1" d="100" />
      </start>
      ...
    </world>

This will set a plane that clips away all geometry after distance 100. Note that in general you probably also want to use distance fog.

### Static LOD

You can replace objects that are far away with lower detail version using static LOD. Check out Level of Detail for more information about how to use this feature.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.