sealed class Tinman.Terrain.Meshing.Texturing

The Texturing class traverses the filtered mesh (see IMeshFilters.FilterIn), generates zero or more TexturingBatch values for each mesh sector and puts an explicit mark on it (see MeshTree.SectorMark), if it has at least one batch.

The mesh sector hierarchy is analysed and TexturingBatch es are assigned to mesh sectors. Each mesh sector that receives a TexturingBatch also gets an explicit mark via MeshTree.SectorMark on the output filter ( IMeshTraversal.FilterOut).

The following vertex data semantics are used by this class:

Public / Constructors


public constructor Texturing → ()

Creates a new instance of Texturing.

Public / Attributes


public attribute Fill → (get,set)

value : bool

true to fill uncovered sectors with TextureAtlasOptions.TextureNullColor, false to omit those texturing batches.

Generate texturing batches in order to fill uncovered sectors?

Defaults to true.


public attribute FilterIn → (get,set)

value : MeshTreeFilter

The filter or null.

The mesh tree input filter to use for querying sector culling and marks.

The default value is null (i.e. all mesh sectors are visited).


public attribute MipmapOffset → (get,set)

value : float32

The level-of-detail of texture tiles. Setting this to 0 means that each texel will cover one pixel (approximately).

The texture mipmap offset can be used to fine-tune the texture output.

The texture detail setting controls the overall texture detail; it is given as the logarithm base four of the number of pixels per texel:

  -2 = log(4^  -2) / log(4)  :  ~0.0625 pixel/texel  (mipmap level   - 2)
  -1 = log(4^  -1) / log(4)  :  ~0.25   pixel/texel  (mipmap level   - 1)
-0.5 = log(4^-0.5) / log(4)  :  ~0.5    pixel/texel
   0 = log(4^   0) / log(4)  :  ~1      pixel/texel  (mipmap level +/- 0)
 0.5 = log(4^ 0.5) / log(4)  :  ~2      pixel/texel
   1 = log(4^   1) / log(4)  :  ~4      pixel/texel  (mipmap level +   1)
   2 = log(4^   2) / log(4)  :  ~16     pixel/texel  (mipmap level +   2)

The mipmap offset setting should be used with care: values significantly greater than zero may introduce texturing artefacts, values significantly less then zero will cause performance penalties.

Defaults to 0.


public attribute Progress → (get)

value : int32

The progress, in percent.

The progress indicator for background loading of texture tiles.

The returned value is updated each time the IBatchRendererBase.ComputeBatches method is called. A value of 100% means that all texture tiles are ready. Lower values indicates how many texture tiles are being loaded in the background.


public attribute TexelSize → (get)

value : float32

The average texel size, given in pixel/texel (MipmapOffset). Will be 0 iff there are no texturing batches.

Returns the average texel size of the current set of texturing batches.


public attribute UseBaseFov → (get,set)

value : bool

true to use only the base field-of-view for texturing,
false to perform texturing according to the current zoom-level.

Always use the base field-of-view when texturing the terrain?

When looking at the horizon with high zoom-levels, terrain texturing might become very busy. To counter-act, this property can be set to false, in order to make texturing behave as if a zoom level of 1 is present.

Defaults to false.