Mesh and LOD

Level Of Detail

Level of Detail (LOD) is the mechanism by which Second Life lowers an object's visual detail by increments as the camera gets further away. When uploading a mesh model, we have complete control over the amount of detail at each level.

Uploading a mesh model step by step on the Second Life Knowledge Base: Uploading a mesh model

Brief Uploader LOD section walk through

Uploader Generated LODs

  1. Choose Build > Upload > Model... from the top menu bar.
  2. In the High file slot click Browse, then select the .dae file on your computer and click Open.
  3. Click on the Medium level slot to highlight that level. Highlighting any level displays that level's model in the Preview pane. Use the up and down arrows on each level to raise or lower the triangle count until satisfied with the transition between the LODs.
  4. Click Calculate weights & fee and see if you like the Land Impact count, but don't upload yet! We still need to adjust the model's physics properties.

For full details on Triangle Limit and Error Threshold, see Upload Model UI reference.

User created LOD files

  1. Choose Build > Upload > Model... from the top menu bar.
  2. In the High LOD slot load the highest detailed model as described above.
  3. In the Medium slot load the second highest LOD model.
  4. In the Low file slot load the second to lowest LOD model
  5. In the Lowest slot load the lowest LOD model.
  6. Click Calculate weights & fee and see if you like the Land Impact count, but don't upload yet! We still need to adjust the model's physics properties.

Physics

Second Life supports custom physics shapes, which can be uploaded with a mesh object or uploaded independently. This allows for the creation of a visually complex object that has a low physics weight. For Havok's official (and extremely technical) best practices in creating physics shapes, see Best practices for creating efficient collision volumes in the Second Life Knowledge Base.

Havok Physics tips and oversimplifications

Havok LOVES cubes, and here is why: Havok is optimized to process cubes nearly instantaneously. Conversely, when Havok encounters an object more complex than a cube(even a hollow or cut cube) it then has to count every single triangle on that object and ponder what to do with each one. So keep those physics shapes as simple as possible!

Here are some guidelines for creating physics shapes for various types of projects:

Physics shapes and how they relate to mesh uploads and LOD

Here are step-by-step instructions on using the physics tab of the mesh uploader.

This tab allows nearly infinite flexibility. Here is a quick description of the uploader physics tab. This is redundant but is needed to illustrate the importance and usefulness of the Analyze button.

Step 1: Level of Detail

Step 2: Analyze

Step 3: Simplify


The goal should always be a the simplest physics shape possible. Use the uploader tools here to keep the geometry and physics count as low as possible.

UV mapping

Anyone who has used the Build Tools inside of Second Life already understands UV mapping, but perhaps under different terminology. UV mapping is simply setting texture repeats(U and V) and offsets. If you look closely at the Build Tools Texture tab you'll see that U and V are used for the texture offset values already. Lean on that familiarity and this concept will come more easily.

General UV mapping techniques

Standard UV mapping

The most common UV map technique divides the mesh surface into neatly flattened sections. Most 3D modeling software packages have this functionality built in.

UV mapping this way has advantages and disadvantages:

Projection UV mapping

Projection UV mapping is much like applying textures to a prim object inworld, the goal of projection UV mapping is to scale, rotate, and offset a diffuse texture so the object wears it perfectly.

Disadvantages:

Baking textures

An advanced feature of most modeling software packages uses both the Standard UV map and the projection maps to render an image. This is sometimes referred to as "baking" a texture. The goal is to use all the texture information stored in the Projection maps to create an image that fits the Standard UV map. This render can be influenced by any lighting or other objects in the scene.

Texture Faces

Normals

A normal is something that is perpendicular to a plane. For the scope of this article, normal describes the direction a face is pointing. Most 3D renderers, the Second Life Viewer included, smartly render only one side of a face. This saves cycles but assumes model is manifold (enclosed in a way that won't encourage views inline with the normal, or are double sided where needed)

Two spheres. Left: Normals pointing out, Right: Normals pointing in.

Smooth Normals

In the case of a round or curved multiple face surface, a normal average can be used. A normal average allows inexpensive surface smoothing. Commonly known as "smooth normals" or "smooth shading", it is an invaluable tool when creating low polygon Second Life content. Smooth normals allow fewer faces to appear as a visually smooth surface, requiring far fewer faces. For example, a five-sided cylinder with smooth normals can appear completely round in Second Life. In some cases, a even a three-sided cylinder can appear perfectly round.

Two five-sided cylinders. Top: Solid normals. Bottom: Smooth normals.

Note where both cylinders intersect the walls, they show the profile of the actual geometry.

Applying smooth normals to some areas and not to others can be useful for adding detail or highlighting edges.

Low polygon modeling

It is important to remember that Hollywood-quality digital models are extremely costly to use in Second Life. Real-time rendering means Second Life must stream triangles and data near the speed of light. Make sure each and every polygon and bit counts! There are many low polygon modeling techniques and software-specific tutorials and tools available around the web.

The goal is to save every triangle you can on the model you plan to upload:

Low polygon texture baking tricks

It is possible to create a very highly detailed model and use it to render gorgeous textures on the faces of a very simple low polygon (Second Life friendly) version. In this case, the name "low polygon modeling" sounds slightly deceptive because you will model and render a very high polygon scene for the purposes of creating the textured illusion. However, the final product is a very efficient, low-polygon model with very detailed textures mapped onto it.

Most modeling software packages have features built in to facilitate this technique.