UV map: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(18 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Glossary]][[Category:Material System]]
{{stub}}
{{stub}}


* '''UV Mapping''' is the process of ''aligning'' and ''adjusting'' how a Texture ([[VTF]]) is applied to a specific Polygonal Mesh. (I'm using the term "mesh" for both brush and model geometry.)
A '''UV map''' is a part of an object's geometry. It defines which areas (using UV coordinates) of a 2D pixelmap should be rendered on which polygonal surfaces (using XYZ coordinates) of a particular 3D mesh. A UV map does not contain any pixel data (eg color, etc). It is only a matrix relating 2D to 3D coordinates.
** To UV map [[Model]]s use [[XSI Texturing|XSI Texture Editor]].
** To UV map [[Brushes]] use [[Hammer Face Edit Dialog]].
** [[VMT|Valve Material Type]] files can also specify UV mapping adjustments for each VTF used by a particular material, via the [[$basetexturetransform]], [[$bumptransform]], etc VMT parameters.
*** {{todo|confirm: these only work for VMTs applied to Brushes, not to Models?}}
*** UV coordinates (eg <code>"center"</code> and/or <code>"translate" <[[integer]] U> <[[integer]] V></code> ?)
*** UV angles  (eg <code>"rotate" <[[angles]]></code> ?)
*** UV divisors (eg <code>"scale" <[[float]] U> <[[float]] V></code> ?)


* Models tend to have a more complex mesh than brushes, which makes UV mapping much more fiddly. Model VTFs therefore tend to be created specially to map easily and efficiently onto one specific model only. Models may use multiple (alternative) skins, so long as the layout of each VTF corresponds to the model's [[UV map]].
Materials apply the pixel data of each VTF (base map, normal map, specular mask) to same UV area of the model. Therefor the model's material can easily be changed without having to create additional UV maps.


* A model's [[UV map]] is an index specifying which area of the relevant [[VTF]]s to apply to each specific polygon of the mesh. The UV map itself does not contain any pixel values (colour, etc), it only indexes the mesh's XYZ vertices to corresponding texture UV coordinates. Each UV map is therefore specific to a mesh rather than a texture file, and so it is stored as ''part of the mesh'' file. A mesh may only have one UV map, but it can use multiple or alternate skins, so long as the layout (coordinates) of each VTF skin is the same.
{{note|Models tend to have a more complex mesh than brushes, which makes UV mapping much more fiddly. Model VTFs therefore tend to be created specially to map easily and efficiently onto one specific model only. Models may use multiple (alternative) skins, so long as the layout of each VTF corresponds to the model's UV map.}}


* {{todo|confirm: "Texture Mapping" means "UV mapping" and a "Texture Map" is a "UV map"?}}


* See [[wikipedia:UV mapping]] for the theory.
'''UV Mapping''', or '''Texture Mapping''', is the process of ''aligning'' Polygons to Pixels.
* See [[wikipedia:UVW mapping]] (used in [[3DS Max]] only?)
* To UV map [[Model]]s use a [[model editor]] (such as {{blender}}).
* To UV map [[Brushes]] use [[Hammer Face Edit Dialog]] (and the [[Hammer Face Edit Disps#Paint Alpha|Paint Alpha Dialog]] for blending Materials on Displacements).
* To UV map [[Decals]] use [[Hammer Decal Tool]].
* To UV map [[Overlays]] use [[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 : <code>"center"</code> and/or <code>"translate" "<0.0 - 1.0 U> <0.0 - 1.0 V>"</code>
** UV angles : <code>"rotate" "<0 - 360>"</code>
** UV scale : <code>"scale" "<[[float]] U> <[[float]] V>"</code>




 
==External links ==
 
* {{wikipedia|UV mapping}} and {{wikipedia|Texture mapping}} for the theory.
[[Category:Material System]]
* The layout of a complex Model Skin is comparable to a {{wikipedia|Texture atlas}}.
[[Category:Glossary]]
* {{wikipedia|UVW mapping}} (used in [[3DS Max]] only?)

Latest revision as of 09:07, 2 February 2024

Stub

This article or section is a stub. You can help by expanding it.

A UV map is a part of an object's geometry. It defines which areas (using UV coordinates) of a 2D pixelmap should be rendered on which polygonal surfaces (using XYZ coordinates) of a particular 3D mesh. A UV map does not contain any pixel data (eg color, etc). It is only a matrix relating 2D to 3D coordinates.

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

Note.pngNote:Models tend to have a more complex mesh than brushes, which makes UV mapping much more fiddly. Model VTFs therefore tend to be created specially to map easily and efficiently onto one specific model only. Models may use multiple (alternative) skins, so long as the layout of each VTF corresponds to the model's UV map.


UV Mapping, or Texture Mapping, is the process of aligning Polygons to Pixels.

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>"


External links