Difference between revisions of "Texture Coordinates"

From polycount
Jump to: navigation, search
m (21 revisions)
(UV Tutorials & Threads: LOD tips from Neox)
 
(41 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- ## page was renamed from [[Category:TextureCoordinates]] -->
+
Texture coordinates, also called UVs, are pairs of numbers stored in the vertices of a mesh.  
= Texture Coordinates =
+
Texture coordinates, also called UVs, are pairs of numbers stored in the vertices of a mesh, often used to stretch a 2D texture onto a 3D mesh.
+
  
 +
These numbers are often used to stretch a 2D texture onto a 3D mesh, but they can be used for other things like coloring the mesh (see [[Vertex color]]), controlling the flow across the surface (see [[Flow map]]), etc.
  
 +
Game engines commonly use two texture coordinates, U and V, for mapping the width and height of a texture. A third axis W can also be used for depth if you are using a 3D volume texture, but usually this coordinate is removed for efficiency.
  
== UV Tutorials ==
+
Texture coordinates are measured in a scale of 0.0 to 1.0, with 0.0 and 1.0 at opposite sides of the texture. When a model has a UV distance greater than 1 (for example, UV goes from -1 to 2) then the texture will tile across the model.
* [http://www.polycount.com/forum/showthread.php?p=1367536 UV Unwrapping Best Practice Factors & Priorities] Polycount Forum thread.
+
 
* [http://www.polycount.com/forum/showthread.php?t=134749 3DS Max - UVing complex objects] Polycount Forum thread, UVs for complex cylindrical-shaped meshes.
+
These numbers are usually hidden from the artist, replaced by helpful visual representations of how the textures are projected. Planes, cylinders and spheres help the artist align the textures in a visual way, but it helps to know that games only see the UV numbers that these shapes create.
* [http://www.polycount.com/forum/showthread.php?t=133646 Best techniques for packing UV’s] Polycount Forum thread.
+
 
* [http://cg.tutsplus.com/sessions/an-introduction-to-uvmapping-in-3d-studio-max/ An Introduction To UVMapping In 3d Studio Max] by Ben Tate.
+
== UV Address Modes ==
* [http://boards.polycount.net/showthread.php?t=70378 UV Theory] Polycount forum thread, how to plan good UVs.
+
[[Image:opengl_clamping.png|none]]
* [http://www.polycount.com/forum/showthread.php?t=80947 As it turns out, we all suck at unwrapping?] Polycount forum thread.
+
Image by [https://open.gl/textures Open.GL].
* [http://www.game-artist.net/forums/support-tech-discussion/182-step-step-techniques-tiling-textures-3ds-max.html Step-by-Step Techniques for Tiling Textures in 3ds Max] - by Chris Holden, how to make [[TextureAtlas|texture atlases]].
+
 
* [http://www.polycount.com/forum/showthread.php?t=82546 Organic rock UV seams] Polycount forum thread, how to create good UVs for spheroids.
+
There are four common methods for controlling how a texture is rendered when the UVs go beyond the 0-1 square. These methods can be chosen with a [[Shader]].
* [http://boards.polycount.net/showthread.php?t=69961 Unwrapping a sphere] Polycount forum thread, good methods for UVing spheres. For sphere modeling tips see [[Sphere Topology]].
+
 
* [[FirstPersonWeaponUV|First-Person Weapon UVs]] by [http://www.linkedin.com/in/earthquake Joe 'EarthQuake' Wilson], good weapon UVs.
+
* Repeat or Wrap is usually the default. The texture will tile.  
* [http://www.cgsharpe.com/?p=55 Maya / Mudbox: Street Cop Workflow] by [http://www.fx81.com/ Mashru Mishu], good character UVs.  
+
* Mirror causes the texture to be flipped along each edge. Mirror has a tendency to create Rorschach/butterfly artifacts, but can be useful in certain situations like fences or railings.  
* [http://boards.polycount.net/showthread.php?t=69286 uv + turbosmooth= big problem] Polycount forum thread, how to prevent 3ds Max subdivision from distorting UVs. A similar thread: [http://boards.polycount.net/showthread.php?t=72686 Best way to approach unwrapping UVWs with Meshsmooth?].
+
* Clamp causes the edge pixels to stretch outwards beyond the edges of the texture. Clamp is great for use with [[Cubemap]]s, since when the texture is [[Texture filtering|filtered]] you don't want seams to appear along the edges of each cube face.
* [http://www.polycount.com/forum/showthread.php?t=80898 What's an 8-sided tiled texture ?] Polycount forum thread, how to edit textures so you can rotate and mirror them on adjacent polygons without seams.
+
* Border causes a solid color to appear outside the edge of the texture. Border is good for use with [[Decal]]s, since you don't want the edges to tile and cause rendering seams.
* [[LightMap]]#Light_Map_Texture_Coordinates
+
 
* [[TextureAtlas]]
+
 
 +
[[UDIM]] is another address method, not used in games. UDIM allows multiple textures to be used by a single model, by offsetting the textures in whole units across UV space. UDIM is useful for texturing in television and film to increase the number of textures per model in a logical and uniform way.
 +
 
 +
 
 +
Usually a single texture pattern is tiled by UV'ing the model outside the 0-1 square. However, multiple tiling textures can be arranged in a [[Texture atlas]] as [http://udn.epicgames.com/Three/TerrainAdvancedTextures.html#Texture%20Packing:%20Implementing%20large%20texture%20tile%20sets sub-tiles] and cropped out using a [[Shaders|shader]]. The shader for this is more expensive than traditional texture tiling, but can be used if you are limited by the number of textures you can use.
 +
 
 +
== UV Tutorials & Threads ==
 +
For better LODs, straighten the perimeter edges of the UV shells. Dents or protrusions along an optimized edge are more likely to create visible seams. The edges don't have to be 90°, diagonal is fine, but the longer and straighter the edges, the better the model can avoid artifacts during reduction.  
  
{| border="1" cellpadding="2" cellspacing="0"
+
{| border="1"
| [[attachment:uvtut_3dprojectionnetwork.jpg|Media:TextureCoordinates/attachments/uvtut_3dprojectionnetwork.jpg
+
|- style="vertical-align:top;"
 +
|[[image:skankerzero_uv_mapping_thoughts_p1of4.png|thumb|none]]
 +
|[[image:skankerzero_uv_mapping_thoughts_p2of4.png|thumb|none]]
 +
|[[image:skankerzero_uv_mapping_thoughts_p3of4.png|thumb|none]]
 +
|[[image:skankerzero_uv_mapping_thoughts_p4of4.png|thumb|none]]
 
|-
 
|-
 +
|colspan="4" style="color:grey;"|UV mapping thought process. Images by [http://www.skankerzero.com/ Jesse "skankerzero" Sosa].
 
|}
 
|}
  
{| border="1" cellpadding="2" cellspacing="0"
+
{|
|-
+
|[[image:uvtut_3dprojectionnetwork.jpg|thumb|left|An automated UV projection network in Maya.<br/>Image by [http://technicalartlead.blogspot.com Paul "prolow" Lohman].]]
 +
|[[image:CarlosMontero_UVChannel2_3dsmax.jpg|thumb|left|How to edit multiple UV channels in 3ds Max.<br/>Image by [http://carlosmontero.com Carlos "cman2k" Montero].]]
 
|}
 
|}
 +
 +
* [http://polycount.com/discussion/200889/head-unwrapping-methods Head Unwrapping-Methods] Polycount Forum thread.
 +
* [http://polycount.com/discussion/175293/what-is-your-prefeered-uv-unwrapping-application/p1 What is your prefeered UV unwrapping application?] Polycount Forum thread.
 +
* [http://polycount.com/discussion/156034/do-we-really-need-to-be-uv-mapping-in-2015/p1 Do we really need to be Uv mapping in 2015?] Polycount Forum thread.
 +
* [http://polycount.com/discussion/comment/2287027/#Comment_2287027 Seamless UVs for baking procedural textures in 3ds Max] by [http://www.hedfiles.net/ Howard Day].
 +
* [http://polycount.com/discussion/85675/uv-unwrapping-best-practice-factors-priorities UV Unwrapping Best Practice Factors & Priorities] Polycount Forum thread.
 +
* [http://polycount.com/discussion/134749/3ds-max-uving-complex-objects/p1 3DS Max - UVing complex objects] Polycount Forum thread, UVs for complex cylindrical-shaped meshes.
 +
* [http://polycount.com/discussion/133646/best-techniques-for-packing-uv%C2%92s/p1 Best techniques for packing UV’s] Polycount Forum thread.
 +
* [http://cgi.tutsplus.com/series/an-introduction-to-uvmapping-in-3d-studio-max--cg-30940 An Introduction To UVMapping In 3d Studio Max] by Ben Tate.
 +
* [http://polycount.com/discussion/70378/uv-theory/p1 UV Theory] Polycount forum thread, how to plan good UVs.
 +
* [http://polycount.com/discussion/80947/as-it-turns-out-we-all-suck-at-unwrapping/p1 As it turns out, we all suck at unwrapping?] Polycount forum thread.
 +
* [http://www.game-artist.net/forums/showthread.php?t=182 Step-by-Step Techniques for Tiling Textures in 3ds Max] - by Chris Holden, how to make [[Texture atlas]]es.
 +
* [http://polycount.com/discussion/82546/organic-rock-uv-seams/p1 Organic rock UV seams] Polycount forum thread, how to create good UVs for spheroids.
 +
* [http://polycount.com/discussion/69961/unwrapping-a-sphere/p1 Unwrapping a sphere] Polycount forum thread, good methods for UVing spheres. For sphere modeling tips see [[SphereTopology]].
 +
* [[FirstPersonWeaponUV|First-Person Weapon UVs]] by [http://www.linkedin.com/in/earthquake Joe 'EarthQuake' Wilson], good weapon UVs.
 +
* [https://web.archive.org/web/20111115114324/http://www.cgsharpe.com/?p=55 Maya / Mudbox: Street Cop Workflow] by [http://www.fx81.com/ Mashru Mishu], good character UVs.
 +
* [http://polycount.com/discussion/80898/whats-an-8-sided-tiled-texture/p1 What's an 8-sided tiled texture ?] Polycount forum thread, how to edit textures so you can rotate and mirror them on adjacent polygons without seams.
 +
* [[Light map#Light_Map_Texture_Coordinates]]
 +
* [[Texture atlas]]
  
 
== UV Tools ==
 
== UV Tools ==
 +
=== Standalone ===
 +
A standalone tool is one which is not directly integrated into another 3D package.
 +
 +
[http://store.steampowered.com/app/363020 IPackThat] by [http://www.pluto13.de/index.php?navtarget=1&lang=en "<nowiki>[PB]</nowiki>Snoelk"]
 +
:* [http://polycount.com/discussion/145328 UV Packer IPackThat] Polycount Forum thread
 +
:* [http://polycount.com/discussion/155057 IPackThat MODO script] Polycount Forum thread
 +
 +
[http://www.pullin-shapes.co.uk/page8.htm RoadKill] by Francis O'Brien
 +
 +
[https://www.uvlayout.com/ UVLayout] by Headus
 +
 
=== 3ds Max ===
 
=== 3ds Max ===
* [http://boards.polycount.net/showthread.php?t=69736 TexTools]
+
* [http://polycount.com/discussion/69736/textools-3-0/p1 TexTools]
 
* [http://www.polytools3d.com/polyunwrapper/index.html PolyUnwrapper]
 
* [http://www.polytools3d.com/polyunwrapper/index.html PolyUnwrapper]
 
* [http://www.scriptspot.com/3ds-max/scripts/texture-atlas-generator Texture Atlas Generator]
 
* [http://www.scriptspot.com/3ds-max/scripts/texture-atlas-generator Texture Atlas Generator]
* [http://boards.polycount.net/showthread.php?t=71073 turboTools]
+
* [http://polycount.com/discussion/71073/turbotools-v1 turboTools]
* [http://boards.polycount.net/showthread.php?t=52415 Normalize UVs Maxscipt]
+
* [http://polycount.com/discussion/52415/normalize-uvs-maxscript/p1 Normalize UVs Maxscipt]
 
* [http://www.luxinia.de/index.php/ArtTools/3dsmax LCSM Unwrap]
 
* [http://www.luxinia.de/index.php/ArtTools/3dsmax LCSM Unwrap]
* [http://boards.polycount.net/showthread.php?t=72045 3ds Max Bridge to Headus UV Layout]
+
* [http://polycount.com/discussion/72045/headus-uv-layout-max-bridge/p1 3ds Max Bridge to Headus UV Layout]
* [http://boards.polycount.net/showthread.php?t=71230 3ds Max Bridge to Roadkill]
+
* [http://polycount.com/discussion/71230/roadkill-3dsmax-2009-2010-script-updated/p1 3ds Max Bridge to Roadkill]
 
* [http://users.skynet.be/arketip/arketip_morphMapENG.htm morphMap]
 
* [http://users.skynet.be/arketip/arketip_morphMapENG.htm morphMap]
  
 
=== Maya ===
 
=== Maya ===
 +
* [http://www.castorlee.com/maya-tools/auto-uv-mapper Castor Lee's Auto UV Mapper]
 
* [http://www.headus.com/phpbb/viewtopic.php?t=394 Maya Bridge to Headus UV Layout]
 
* [http://www.headus.com/phpbb/viewtopic.php?t=394 Maya Bridge to Headus UV Layout]
 +
* [http://polycount.com/discussion/105380/nightshade-uv-editor-maya-script/p1 Nightshade UV Editor]
 
* [http://www.creativecrash.com/maya/downloads/scripts-plugins/texturing/c/ Texturing Scripts on CreativeCrash.com]
 
* [http://www.creativecrash.com/maya/downloads/scripts-plugins/texturing/c/ Texturing Scripts on CreativeCrash.com]
* [http://www.castorlee.com/maya-tools/auto-uv-mapper Castor Lee's Auto UV Mapper]
+
* [http://www.creativecrash.com/maya/script/uvdeluxe UVDeluxe]
  
 
=== Softimage / XSI ===
 
=== Softimage / XSI ===
 
* [http://www.sshadows2005.narod.ru/main/programming/softimage/headusuvlayout.htm Softimage Bridge to Headus UV Layout]
 
* [http://www.sshadows2005.narod.ru/main/programming/softimage/headusuvlayout.htm Softimage Bridge to Headus UV Layout]
 
* [http://www.creativecrash.com/xsi/downloads/scripts-plugins/texturing/c/ Texturing Scripts on CreativeCrash.com]
 
* [http://www.creativecrash.com/xsi/downloads/scripts-plugins/texturing/c/ Texturing Scripts on CreativeCrash.com]
* [http://sculptwork.com/rr/bak/kim/roadkill.zip Softimage Bridge to Roadkill]
 
  
 
== UV Map Grids ==
 
== UV Map Grids ==
This is a texture to use while unwrapping a mesh. Sometimes called a custom uv map template, a uv checker, or a test grid.  
+
The grid is a texture to use while unwrapping a mesh. Sometimes called a custom UV map template, a UV checker, or a test grid.  
  
Good things to have in a uv map grid:
+
Good things to have in a UV map grid:
 
* A large checker grid to see large distortions.
 
* A large checker grid to see large distortions.
 
* A fine per-pixel grid to see small distortions.
 
* A fine per-pixel grid to see small distortions.
Line 64: Line 108:
 
* Letters and/or numbers to see where a mesh feature is located in UV space.
 
* Letters and/or numbers to see where a mesh feature is located in UV space.
  
{| border="1" cellpadding="2" cellspacing="0"
+
{|
| [[attachment:uvrefmap_blackwhite.jpg|Media:TextureCoordinates/attachments/uvrefmap_blackwhite.jpg
+
| [[File:uvrefmap_circles_letters.jpg|thumb]]
| width=128}}
+
| [[File:uvrefmap_circles.jpg|thumb]]
| [[attachment:uvrefmap_blender.jpg|[[Media:uvrefmap_blender.jpg
+
| [[File:uvrefmap_checker_green.gif|thumb]]
| width=128]]]]
+
| [[File:uvrefmap_circles_noise.jpg|thumb]]
| [[attachment:uvrefmap_checker_green.gif|{{attachment:uvrefmap_checker_green.gif
+
|-
+
| [[attachment:uvrefmap_checker_util-mark.jpg|Media:TextureCoordinates/attachments/uvrefmap_checker_util-mark.jpg
+
| width=128}}
+
| [[attachment:uvrefmap_checkeredmap.jpg|[[Media:uvrefmap_checkeredmap.jpg
+
| width=128]]]]
+
| [[attachment:uvrefmap_circles.jpg|{{attachment:uvrefmap_circles.jpg
+
 
|-
 
|-
| [[attachment:uvrefmap_circles_letters.jpg|Media:TextureCoordinates/attachments/uvrefmap_circles_letters.jpg
+
| [[File:uvrefmap_circlesgreen_noise.jpg|thumb]]
| width=128}}
+
| [[File:uvrefmap_circlessquares.jpg|thumb]]
| [[attachment:uvrefmap_circles_noise.jpg|[[Media:uvrefmap_circles_noise.jpg
+
| [[File:uvrefmap_nvidia_greengrid.jpg|thumb]]
| width=128]]]]
+
| [[File:uvrefmap_util-mark1.jpg|thumb]]
| [[attachment:uvrefmap_circles_R_numbers.jpg|{{attachment:uvrefmap_circles_R_numbers.jpg
+
 
|-
 
|-
| [[attachment:uvrefmap_circlesgreen_noise.jpg|Media:TextureCoordinates/attachments/uvrefmap_circlesgreen_noise.jpg
+
| [[File:muse_uv_01-01-1024x1024.jpg|thumb]]
| width=128}}
+
| [[File:uvrefmap_blender.jpg|thumb]]
| [[attachment:uvrefmap_circlessquares.jpg|[[Media:uvrefmap_circlessquares.jpg
+
| [[File:uvrefmap_checkeredmap.jpg|thumb]]
| width=128]]]]
+
| [[File:uvrefmap_checker_util-mark.jpg|thumb]]
| [[attachment:uvrefmap_grid_large.jpg|{{attachment:uvrefmap_grid_large.jpg
+
 
|-
 
|-
| [[attachment:uvrefmap_grid_small.jpg|Media:TextureCoordinates/attachments/uvrefmap_grid_small.jpg
+
| [[File:uvrefmap_grid_large.jpg|thumb]]
| width=128}}
+
| [[File:uvrefmap_grid_small.jpg|thumb]]
| [[attachment:uvrefmap_HarlequiN_grid.jpg|[[Media:uvrefmap_HarlequiN_grid.jpg
+
| [[File:uvrefmap_blackwhite.jpg|thumb]]
| width=128]]]]
+
| [[File:uvrefmap_HarlequiN_grid.jpg|thumb]]
| [[attachment:uvrefmap_nvidia_greengrid.jpg|{{attachment:uvrefmap_nvidia_greengrid.jpg
+
 
|-
 
|-
| [[attachment:uvrefmap_util-mark1.jpg|Media:TextureCoordinates/attachments/uvrefmap_util-mark1.jpg
+
| [[File:uv_mapping_grid_by_cymae.jpg|thumb]]
| width=128]]
+
+
 
|}
 
|}
  
 
----
 
----
[[Category:EnvironmentTexturing]] [[Category:CharacterTexturing]] [[Category:PropsTexturing]] [[Category:TextureTechnique]] [[Category:Glossary]]
+
[[Category:Texturing]] [[Category:EnvironmentTexturing]] [[Category:CharacterTexturing]] [[Category:PropsTexturing]] [[Category:TextureTechnique]] [[Category:Glossary]]

Latest revision as of 21:40, 17 May 2020

Texture coordinates, also called UVs, are pairs of numbers stored in the vertices of a mesh.

These numbers are often used to stretch a 2D texture onto a 3D mesh, but they can be used for other things like coloring the mesh (see Vertex color), controlling the flow across the surface (see Flow map), etc.

Game engines commonly use two texture coordinates, U and V, for mapping the width and height of a texture. A third axis W can also be used for depth if you are using a 3D volume texture, but usually this coordinate is removed for efficiency.

Texture coordinates are measured in a scale of 0.0 to 1.0, with 0.0 and 1.0 at opposite sides of the texture. When a model has a UV distance greater than 1 (for example, UV goes from -1 to 2) then the texture will tile across the model.

These numbers are usually hidden from the artist, replaced by helpful visual representations of how the textures are projected. Planes, cylinders and spheres help the artist align the textures in a visual way, but it helps to know that games only see the UV numbers that these shapes create.

UV Address Modes

Opengl clamping.png

Image by Open.GL.

There are four common methods for controlling how a texture is rendered when the UVs go beyond the 0-1 square. These methods can be chosen with a Shader.

  • Repeat or Wrap is usually the default. The texture will tile.
  • Mirror causes the texture to be flipped along each edge. Mirror has a tendency to create Rorschach/butterfly artifacts, but can be useful in certain situations like fences or railings.
  • Clamp causes the edge pixels to stretch outwards beyond the edges of the texture. Clamp is great for use with Cubemaps, since when the texture is filtered you don't want seams to appear along the edges of each cube face.
  • Border causes a solid color to appear outside the edge of the texture. Border is good for use with Decals, since you don't want the edges to tile and cause rendering seams.


UDIM is another address method, not used in games. UDIM allows multiple textures to be used by a single model, by offsetting the textures in whole units across UV space. UDIM is useful for texturing in television and film to increase the number of textures per model in a logical and uniform way.


Usually a single texture pattern is tiled by UV'ing the model outside the 0-1 square. However, multiple tiling textures can be arranged in a Texture atlas as sub-tiles and cropped out using a shader. The shader for this is more expensive than traditional texture tiling, but can be used if you are limited by the number of textures you can use.

UV Tutorials & Threads

For better LODs, straighten the perimeter edges of the UV shells. Dents or protrusions along an optimized edge are more likely to create visible seams. The edges don't have to be 90°, diagonal is fine, but the longer and straighter the edges, the better the model can avoid artifacts during reduction.

Skankerzero uv mapping thoughts p1of4.png
Skankerzero uv mapping thoughts p2of4.png
Skankerzero uv mapping thoughts p3of4.png
Skankerzero uv mapping thoughts p4of4.png
UV mapping thought process. Images by Jesse "skankerzero" Sosa.
An automated UV projection network in Maya.
Image by Paul "prolow" Lohman.
How to edit multiple UV channels in 3ds Max.
Image by Carlos "cman2k" Montero.

UV Tools

Standalone

A standalone tool is one which is not directly integrated into another 3D package.

IPackThat by "[PB]Snoelk"

RoadKill by Francis O'Brien

UVLayout by Headus

3ds Max

Maya

Softimage / XSI

UV Map Grids

The grid is a texture to use while unwrapping a mesh. Sometimes called a custom UV map template, a UV checker, or a test grid.

Good things to have in a UV map grid:

  • A large checker grid to see large distortions.
  • A fine per-pixel grid to see small distortions.
  • Circles help with solving distortion, as it's easier for the human eye to see when a circle is distorted than a square.
  • Unique colors across the map, to see where the UV is tiling.
  • Letters and/or numbers to see when the UV is reversed.
  • Letters and/or numbers to see where a mesh feature is located in UV space.
Uvrefmap circles letters.jpg
Uvrefmap circles.jpg
Uvrefmap checker green.gif
Uvrefmap circles noise.jpg
Uvrefmap circlesgreen noise.jpg
Uvrefmap circlessquares.jpg
Uvrefmap nvidia greengrid.jpg
Uvrefmap util-mark1.jpg
Muse uv 01-01-1024x1024.jpg
Uvrefmap blender.jpg
Uvrefmap checkeredmap.jpg
Uvrefmap checker util-mark.jpg
Uvrefmap grid large.jpg
Uvrefmap grid small.jpg
Uvrefmap blackwhite.jpg
Uvrefmap HarlequiN grid.jpg
Uv mapping grid by cymae.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Tools