HOW TO SETUP LEVELS OF DETAIL by Cory Mogk

Play Movie [162kb]

This how-to looks at some of the features in version 3.0 and shows how they can be used together to create various levels of detail (LOD) for an interactive application.

In this lesson you will create two lower resolutions of an existing model and then set-up Level of Detail so that your model switches between resolutions based on the distance to camera.

   STEP ONE

Download the project files for your platform:

Set your project to Lod and open the powerUp.ma file from the scenes directory.

This high resolution model of the Jester's head has some potentially problematic polygons; some polygons are non-planar and some are n-sided (more than four sides). This may result in edges flipping and textures popping or moving when handled by the game engine. The Cleanup tool can be used to fix this.

Select the head and open the Cleanup options box with Polygons > Cleanup > Options.

Reset the settings and click to turn On the 4-sided Faces and Faces with more than 4 sides.

Press Cleanup. The model will be triangulated to solve the problems.

When a model is triangulated from quads, you will notice that the polygon count increases. This happens because you are splitting a single quad into two triangular polygons.

Rename the head to powerUpHi.

NOTE: Cleanup can be used as a selection aid by changing the Operation to Select Geometry. The benefit of this is that you can highlight and then fix the potential problems as you like.

   STEP TWO

You will now make a medium resolution head.

Duplicate the powerUpHI head and rename it to powerUpMed. Move it to the side of the powerUpHi head.

With the powerUpMed head selected, open Polygons > Reduce > Options.

From the options window select Edit > Reset Settings and set the options:

  • Reduce by (%) to 31.404
  • Geometry Border Edges to Off
  • Border Point Preservation to 0.752
  • Hard Edges to Off
  • Sharp Geometry Angles to 0.868
  • High Curvature to 0.223

Press Reduce. The polygon count of the head will decrease to about half. The values for the above options were chosen through experimentation. You may adjust the values of the polyReduce input node in the channel box for your own experimentation.

NOTE: The values that you set in the Options Box will not relate to what you see in the Channel Box. Below is a table that shows you the correct mapping.

Mapping From Options Box to Channel Box

Options Box Channel Box
Reduce by % Percentage
Geometry Border Edges Keep Border
Border Point Preservation Border - which is (1 minus value entered in Option Box)
UV Border Edges Keep Map Border
Hard Edges Keep Hard Edge
Sharp Geometry Angles Line - which is (1 minus value entered in Option Box)
High Curvature Detail - which is (1 minus value entered in Option Box)

NOTE: While this reduced head may not be suitable for an actual game, it will suffice for the learning purposes of this how-to. If this head were to be used, further polygon reduction could be achieved be deleting edges. The texture should also be modified for a more consistent look.

   STEP THREE

You will now make a low resolution head.

The low resolution head will be made by rendering the high resolution head and mapping the image to a polygonal plane.

Create a Polygon Plane. Scale the plane so that it fits the shape of the powerUpHi head as shown.

Rename the plane to powerUpLo.

   STEP FOUR

You will now make a texture map for the powerUpLo head.

Hide the powerUpLo plane. Create an ambient light in front of the powerUpHi head.

Adjust the following Render Globals settings:

Under Resolution set the following:

  • Width to 128
  • Height to 128

Under Render Options set the following

  • Composite to On
  • Composite Threshold to 1.0

NOTE: Setting these values renders the mask for the image with a hard edge. If Composite is turned Off (or Composite Threshold is set to 0.0) the edges of the alpha channel will be soft or feathered causing the edge of the mask not to be sharp.

Render the Front Window and save the image as powerUpLo. The most important settings above are Composite and Composite Threshold.

Map the new image onto the Color channel of a new Lambert material. Apply this Lambert to the plane. You may need to adjust the Repeat and Offset values so that the image matches with the powerUpHi head.

You will now use these three models to set up the levels of detail.

  STEP FIVE

Now that the different versions of the head are created, they can be used to set-up one node that will switch the display based on the camera distance.

Move the powerUpMed head back to the origin so that all three versions of the head are placed in the same positions. Select the window of the camera you would like to create the Level of Detail. In the Hypergraph window, Select the heads in order:

    1. powerUpHi
    2. powerUpMed
    3. powerUpLo

Create an LOD group using Edit > Level of Detail > Group.

The three versions of the head will be grouped together. As you dolly the camera in and out of the selected window you will be able to see the different models change according to the distance from the camera.

If you select the lodGroup node you can adjust the distance at which the models will change in the channel box. The threshold attributes display at what distance the models will swap. The order in which the models swap can be easily adjusted by reordering the nodes under the lodGroup node by drag and dropping with CTRL and MMB.

Play Movie [162kb]

CONCLUSION

The Level of Detail tool makes LOD creation and manipulation quite seamless.

The addition of the cleanup and reduction tools help to facilitate the set-up of levels of detail.

Your use of this file confirms your agreement to the
Terms and Conditions set out in the Terms and Conditions page.