Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

export:worldspace-maps:lod

export:worldspace-maps:lod <data-directory> --output-directory <dir> [--level <4|8|16|32|auto>] [--max-size <px>] [--hillshade] [<shared options>]

The shared options are in Worldspace maps.

Draws each worldspace’s map over its terrain LOD diffuse tiles, stitched. The tiles show the terrain only: there is no object LOD. Buildings, rocks and trees need --objects, roads and trails --roads, see Objects and Roads. A worldspace that uses its parent’s LOD is drawn from it with --parent-lod, see Parent LOD.

It builds on the same tile derivation as debug:*:archive:terrain-lod, for every worldspace of the load order instead of one. The sources for the tile naming and the lodsettings layout are listed in assumptions.

Pipeline

The background is Pipelines/Maps/Backgrounds/Lod/LodBackground.cs. For each planned worldspace, LodRenderer:

  1. Reads lodsettings\<editor id>.lod from the archive file system (LOD settings format). It gives the tile grid’s origin and the levels that exist. A worldspace drawn with --parent-lod reads its parent’s.
  2. Picks the level: --level, or with --level auto the finest one that fits --max-size (see Size).
  3. Groups the planned cells into tiles (LodTile) stepping by the level from the settings’ origin, and extracts each tile’s diffuse .dds from the archive file system (TerrainLodTileSource).
  4. Decodes each tile (DdsDecoder.TryDecode, see DDS textures). With --hillshade, also decodes its _n.dds normal map, scaled to the tile (TerrainLodNormals, see below).
  5. Redraws each placeholder tile, and its normal map, from the next finer level (see below).
  6. Places every tile on a north-up grid, scaled to the largest tile’s size, and with a crop keeps the part over the kept cells (MapProjection).
  7. Draws a region of the map (LodRaster): each tile under it, scaled with nearest-neighbor sampling, tiles in parallel, and with --hillshade each pixel’s normal from its tile’s normal map. A tile that is missing or can’t be decoded stays transparent. The layers are drawn next.

A tile covers --level x --level cells whether or not they exist, and vanilla tiles are black where a cell has no LAND (most of MarkarthWorld’s only level-32 tile): --crop-to-playable clears them.

Size

--level sets how many cells a LOD tile covers on each side: 4, 8, 16 or 32 (LOD_LOWLEVEL, the default). A vanilla tile is 256x256 pixels, so a level gives 256 / level pixels per cell: 8 at level 32, 64 at level 4. A finer level reads finer tiles: the detail grows with the image. Tamriel fits in a 1024x1024 image at level 32, and is a grid of about 31x24 tiles, 7936x6144 pixels, at level 4.

Automatic level

--level auto tries the levels the worldspace’s LOD settings generate, finest first, and keeps the first one whose image fits --max-size pixels on its longest side (default 2048). The size is measured from the DDS headers of the tiles, before decoding them. One tile’s header is read first: when that tile alone already makes the image too large, the level is skipped without extracting the others. When no level fits, the coarsest level with tiles is used. A small worldspace gets level 4 (64 pixels per cell with 256x256 tiles), Tamriel gets level 16. JaphetsFollyWorld, whose LOD stops at level 16, gets a map only this way.

Placeholder tiles

Vanilla ships tiles much smaller than the others: at level 32, Tamriel’s 4x4 tamriel.32.-64.-64.dds sits next to 256x256 tiles. Scaled up, it’s a block of 64x64-pixel squares, and its normal map shades each square as one flat facet. A tile smaller than the largest tile of its level is redrawn from the four tiles of the next finer level covering it, recursively while a child is itself too small. It stays as is when the settings generate no finer level or none of the children exists. tamriel.32.-64.-64 is the only placeholder among Tamriel’s tiles, and every level-16 tile under it is 256x256.

Hillshade

The _n.dds next to each diffuse tile is a world-space normal map: red is east, green is up and blue is north (see assumptions). --hillshade lights it from the north-west, 45 degrees above the horizon, the usual convention for shaded relief maps, or from the preset of --hillshade-hour (see Hillshade hour). The tile isn’t shaded as it is read: each pixel leaves the normal of its texel to the lighting layer, which lights the tiles and the objects in one pass, by the map’s one formula, see Map shading. A tile whose normal map is missing or undecodable is left unlit. Flat ground keeps its diffuse color. A slope facing the light gets up to 23% brighter from the north-west; under a lower light the factor stops at 35% brighter. A slope facing away keeps at least 55% of its color.

Without --hillshade, neither the tiles nor the objects are shaded.

The tiles take the formula’s slope term only. The broad relief, the curvature and the cast shadows are measured on VHGT heights, which this background doesn’t read: see Hillshade and Surface relief.

The shading is per pixel of the LOD tile, so its detail follows the level: 8x8 pixels per cell at level 32, 64x64 at level 4. It shows mountain ranges and valleys, not paths or buildings: the layers add them.

Parent LOD

A worldspace whose PNAM sets “Use LOD Data” has no terrain LOD of its own. Without --parent-lod, it gets no map. With --parent-lod, it is drawn from the tiles and lodsettings of its parent, cropped to its cells (see Parent LOD).

The image is the parent’s terrain LOD, not the city’s buildings: Tamriel’s LOD shows Whiterun as a flat dark area. --objects draws them over it, see Objects. MarkarthWorld has its own LOD and is drawn without --parent-lod.

Worldspaces without a map

A worldspace without the requested LOD counts in the shared warning, which reads “have no level-32 terrain LOD”. Its --verbose reason is one of the shared ones, or:

  • no lodsettings\<editor id>.lod in the archives;
  • its LOD settings don’t generate this level (JaphetsFollyWorld stops at 16);
  • none of its expected tiles is in the archives, or none decodes;
  • with --parent-lod, its LOD parent has no EditorID, which names its LOD folder.

On the vanilla SE load order at level 32, every worldspace with a lodsettings file gets a map except JaphetsFollyWorld, which --level auto draws. A tile missing or undecodable stays transparent and is counted in one warning per worldspace.