Texture
Every game needs a crate texture
Early on textures was simply mapped onto the polygons. Then with the use of multiple textures one could started to blend them in the fixed function pipeline. Now with shaders textures are not so much specific images but rather data that one needs to pick and choose how to use them in the shader. For the details on how textures are used and abused look in the Material section.
Texture Dimension
A texture can be in one-, two-, or three-dimensions. A 2D texture is a image, a 3D texture is a volume and a 1D texture is like a gradient. Each element in the texture is called a texel and to select a texel one use coordinates of the same dimension as the texture. The coordinates normally go from 0 to 1 so [0.5,0.5] is in the middle of a 2D texture. Getting the texel from the texture with a coordinate is called sampling the texture. A texture can also be in the form of a Cubemap.
Texture Size
The size of the texture is how big each dimension is in number of texel's. It's common for sizes to be power of two (64,128,256,512,...) as graphic cards liked it best that way. The size in all the dimensions does not need to be the same. The max size supported depends on the graphic card and available memory. One solution to large textures is to use Virtual Texture that are not all loaded at the same time.
Texture Format
The format of a texture describe what data each texel contain.
- Texture formats for 2D games - 2015 : Part 1, 2: Palettes, 3: DXT and PVRTC and 4: Overview.
- Understanding BCn Texture Compression Formats - 2012
- Texture tiling and swizzling - 2011
- Using ASTC Texture Compression for Game Assets
Filtering and Mipmapping
Say there is a textured surface on the screen where each texel is covering one pixel. If the surface move closer each texel with start to cover more then one pixel, known as texture magnification. If the surface move away there will be more then one texel inside each pixel, known as texture minification. In each of these cases a filtering function is used to select what the color of the texel that is sampled from the texture will be. The visual quality can be improved with mipmaps. A mipmap for a texture is a chain of down sampled images of the texture. So a 256x256 texture have mipmaps of size 128x128,64x64,32x32 and so on. When trying to sample a texture the mipmap is first selected depending on the distance to the surface drawn and then the mipmap is sampled with the filter functions. Mipmaps only affect minification.
Texture filtering
- Nearest: Takes the texel closest to the ones that we try to sample. Creates a Minecraft style blocky pixel effect during magnification.
- Bilinear: Take the four nearest texels to the part we try to sample and combine them.
- Trilinear: Select the two closest mipmaps and sample them both with bilinear filtering. The two values are then interpolated for the final result.
- Anisotropic:
- Mip-mapping is hard – importance of keeping your quads full - 2019
- Shadow Maps Don’t (Always) Need Mips - 2014
- Quick example of Anisotropic Filtering in OpenGL - 2012
- A Way to Visualize Mip Levels - 2011
- Computing Alpha Mipmaps - 2010
- Mipmaps, generation and level selection - 2008
- Applying Sampling Theory To Real-Time Graphics
- Mipmapping with Bidirectional Techniques
- Mip-mapping is hard – importance of keeping your quads fullFake vs True Displacement - Part 1/2 - 2020
- stable filtering — part 2 - 2019
- Bilinear texture filtering – artifacts, alternatives, and frequency domain analysis - 2020
Noise
Links
Procedural Stochastic Textures by Tiling and Blending - 2019
MinLod: A Cheap&Simple Method to Increase Texture Details at Acute Angles - 2018
roughness mip maps based on normal maps? - 2018
Conformal Texture Mapping - 2017
Rethinking Texture Mapping - 2017
Mesh Color Textures - 2017
The Implementation Of A Scalable Texture Cache - 2017
Mesh Color Textures - 2017
Rethinking Texture Mapping course notes - 2017
The Next Frontier of Texturing Workflows - 2016
Texture atlases, wrapping and mip mapping - 2013
A Closer Look At Parallax Occlusion Mapping - 2013
Applying Sampling Theory To Real-Time Graphics - 2012
Textures : can we cheat ? - 2011
Reference Guide For the Beginner Artist - 2008
The Art of Texturing Using The OpenGL Shading Language - 2005
Texture Splatting in Direct3D - 2005
Normal Mapping - 2018
A brief history of 3D texturing in video games - 2019
Announcing the NVIDIA Texture Tools Exporter 2020.1 - 2020
Generating Perfect Normal Maps for Unity (and Other Programs) - 2020
World space UVs & Triplanar Mapping - 2020
Texture Generation Part 2: Normal Swizzling - 2020
Texture Generation - 2020
Complex Maps Masks, Details, and Normals - 2019
Alpha Compositing - 2019