Home | Lehre | Videos | Texte | Vorträge | Software | Person | Impressum, Datenschutzerklärung | Blog
See subsection 4.2 through section 6 of my tutorial.
Texturing
-
"Put wallpaper onto 3D geometry"
-
Control color, glossiness, transparency, ... (demo with Cinema 4D)
-
How to place textures on surfaces?
-
Simple solution: use projections such as orthogonal, cylindrical or spherical
(demo with Cinema 4D)
-
Problem 1: Textures slip under deformations.
-
Problem 2: The placement is too strongly restricted.
-
Better solution: "Texture coordinates". Equip every vertex with the coordinates
of its corresponding point in the texture. These coordinates are called
u and v, sometimes r and s. Demo with Cinema 4D / BodyPaint 3D and XNA.
Between the vertices, texture coordinates are interpolated linearly. On
top of that, a perspective correction is applied.
-
Technical term: Pixels of a texture are called "texels" (texture elements).
Texture Interpolation, Texture Filtering
On rendering, the texels neither are not of the same size as the pixels
of the screen, nor are the texels aligned to the pixels. Hence, we need
color values "between" existing texels. Typically, these are computed using
linear interpolation (or rather bilinear interpolation because it's
done in two directions: u and v). Demo with XNA.
If the texels become significantly smaller than the pixels, we'll see
moiré (=aliasing) patterns in the rendering. Demo with XNA and Cinema
4D. To suppress this effect, "MIP mapping" is used (MIP stands for "multum
in parvo": much in little). A MIP map contains the texture image in several
levels of resolution, each one two times the sidelength of the next. With
linear MIP map interpolation, the graphics chip chooses the two most appropriate
levels and blends them linearly. Hence, trilinear interpolation,
because we're interpolating in u, v, and MIP level. Demo with XNA.
Alpha Blending
We may use a forth color component (alpha, hence ARGB) to control transparency.
Demo with XNA. Note that "alpha blending" incurs a dependency on the order
in which objects are rendered.
Bump Mapping
Textures may also be used to control shape:
-
Displacement Mapping: Deform the geometry along the normal direction, controlled
by a gray-scale image. Needs finely tesselated geometry. Demo with Cinema
4D. Nvidia graphics cards can do this in hardware, too. Demo with XNA.
-
Bump Mapping: Do not actually deform geometry, but compute the lighting
with a deform normal vector. Works with coarse geometry and hence is fast.
But the profiles of objects look undeformed, and strong deformations tend
to look wrong. Most current graphics cards can do this (with some programming
effort). Demo with XNA.