Skip to content

05. UV Maps

skyslide22 edited this page Jun 8, 2024 · 12 revisions

UV Maps

Important

Every object must have two uv layers, with these exact names and in this order:

  • BaseMaterial
  • LightMap

UV Maps are used to display textures on your object, shortly: your 3d object geometry is projected on an image 2d image.

UV Layer 1. – BaseMaterial

The BaseMaterial is the main uv layer which stores the uv projections of your object which will be used to put the texture on your models. A material specifies, which textures will be used later in maniaplanet/trackmania2020, but for development, you can use any texture you like in blender, it will have no effect in-game. The uv islands(connected faces) can overlap each other without any issues. Also, the uv islands can be placed outside the bound box area, if so, the texture will be repeated, as seen here:

uvmap

UV Layer 2. – LightMap

Note

You can ignore this uv layer if you plan to modify the item later in-game in the meshmodeler. In this case, the quality of the lightmap has no effect since it will be overridden by the meshmodeler.

The lightmap uvlayer is used for ingame shadow calculations and has usually 2048x2048 pixel, this jpg/webp file will be generated during the shadow calculation of your map and is saved in the .Map.Gbx file.

Note

All lightmaps of your used objects in your map are mapped on that 2048px image, so the lightmap of your object will probably take up 32x32px or even less space, it depends on your item size & usage count. You can modify the priority with an openplanet plugin tho.

All objects in your exported collection will share one lightmap – in other words: all objects in your collection will get merged into one object on export, so avoid overlapping islands in this case. To see overlapping, select the lightmap uv layer for all objects and then go into edit mode while all objects are selected, or just use the Lightmap button in the Manipulations tab, which will show you the BaseMaterial or LightMap uv layer for all objects with one click, use the pencil icon next to it to edit all lightmaps at once.

Tipps

  • keep spaces between your uv islands (uv island = connected faces)

  • connect as much faces as possible, split up when it makes sense

  • best method is u > "Unwrap"

    • works best with mark seams (red lines); select edges and then ctrl + u > "Mark Seam"
  • avoid overlapping of faces at all cost, it will not cause any game crashes or problems but some annoying and weird shading issues like dark areas on areas where the sun or any other light hits the face

  • u > "Lightmap Pack" is the worst method you can use, never ever use it for trackmania lightmaps!

  • u > "Smart UV Project" works "OK", increase the angle up to 89° and add some margin

  • by having many uv islands, the shadows will be calculated correctly, but will cause some bad dark "random" fragments (same as meshmodeler)

  • you should keep faces connected where it makes sense, for example, a cylinder should not have 5 uv islands, but 3, two circles(bottom, top) and the faces around, not separated but all connected except one cut("Mark Seam").

  • imagine opening a christmas gift, the paper around the "cube/box" is one paper, not 5 papers, keep it simple

  • a cube can also be unwrapped as one uv island, but surely you can split the cube into 6 uv islands with ctrl + e > "Mark Seam"

Here is a OK example of a lightmap generated with the smart uv project method using 89° as angle:

uvmap

Examples of a good lightmap

Tip

This is how a good lightmap of a broken lying pillar should look like:

  • "Unwrap" method used
  • "Mark Seam" method used, unwrap will split on the red marked edges
  • uv islands have proper space between
  • cylinders have only one cut ("Smart UV Project" will make more, use "Unwrap"!)

uvmap

Tip

GOOD: Box lightmap using "Smart UV Project" with margin between islands

uvmap

Tip

GOOD: Sphere lightmap using "Unwrap" in combination with "Mark Seam"

uvmap

Tip

GOOD: Cylinder lightmap using "Unwrap" in combination with "Mark Seam"

uvmap

Tip

GOOD: Terrain lightmap using "Unwrap" in combination with "Mark Seam"

uvmap

Examples of a bad lightmaps, not recommended

Caution

Example of a bad lightmap:

  • by having overlapping islands, the shadows will be calculated incorrect

uvmap

Caution

BAD: Box lightmap using "Lightmap Pack"

uvmap

Caution

BAD: Box lightmap using "Smart UV Project" without any margin

uvmap

Caution

BAD: Sphere lightmap using "Lightmap Pack" on a sphere

uvmap

Caution

BAD: Sphere lightmap using "Smart UV Project" too many islands

uvmap

Caution

BAD: Cylinder lightmap uv islands with no margin

uvmap

Caution

BAD: Terrain lightmap using "Smart UV Project" too many unnecessary islands

uvmap