UV map

From Valve Developer Community
Jump to navigation Jump to search
English (en)Русский (ru)Translate (Translate)
This article or section is a stub. You can help by expanding it.
Texture Space Some graphics APIs sample the texture from the top left to the bottom right ↘ while others sample from the bottom left to the top right ↗. Some may also refer to UVW as STU coordinates originating from parametric mathematics.

The Source Engine's code references both UV and ST conventions.

1 V ↑
0 U → 1

A UV map is a property of a model's geometry data that does not contain any pixel data (eg color, etc). It is essentially a matrix relating 3D to 2D coordinates which defines the area of a 2D pixelmap to be sampled and rendered onto each polygonal surface. The mesh vertices store UV float positions [0 - 1] for each face it comprises [confirm], this means a vertex that connects multiple faces can represent multiple points within a UV map. UV vertices are then connect together into faces at the same time faces of the mesh are generated [confirm]. The method of defining vertex UV coordinates is called UV mapping, UV unwrapping or skinning.

Materials apply the pixel data of each VTF (base map, normal map, specular mask) to the same UV area of the model. Therefore the model's material/skin) can easily be changed without having to create additional UV maps.

UV maps are usually repeating tiles where the geometry can move beyond the bounds of the first tile and still render with textures. This is useful for managing complicated layouts and/or reusing texture space of multiple disconnected meshes, though it is mostly used on tiling textures/trimsheets.

To UV map a
To UV map: Use
Models model editor (such as Blender Blender)
Brushes Hammer Face Edit Dialog (and the Paint Alpha Dialog for blending Materials on Displacements)
Decals Hammer Decal Tool
Overlays Hammer Overlay Tool

VMT files can also specify UV mapping adjustments for each VTF seperately, via the $basetexturetransform, $bumptransform, etc VMT parameters.

Todo: confirm: this only works for VMTs applied to Brushes, not to Models?
    • U (horizontal) and V (vertical) coordinates are calibrated from 0 to 1, so "0.5 0.5" is always the center of the VTF.
    • UV coordinates : "center" and/or "translate" "<0.0 - 1.0 U> <0.0 - 1.0 V>"
    • UV angles : "rotate" "<0 - 360>"
    • UV scale : "scale" "<float U> <float V>"

Sampling

Todo:  linear, bi-linear, tri-linear interpolation

Secondary UV

Todo: used in source 2

UV Animation

Todo: used in foliage shader in source 2

External links

See also