classic mapping technique
DESCRIPTION
Classic mapping technique. 7.1 Introduction 7.2 Two-dimensional texture maps to polygon mesh objects 7.3 Two-dimensional texture domain to bi-cubic parametric patch objects 7.4 Bump mapping 7.5 Environment or reflection mapping 7.6 Three-dimensional texture domain techniques - PowerPoint PPT PresentationTRANSCRIPT
Classic mapping technique7.1 Introduction7.2 Two-dimensional texture maps to polygon mesh
objects7.3 Two-dimensional texture domain to bi-cubic
parametric patch objects7.4 Bump mapping7.5 Environment or reflection mapping7.6 Three-dimensional texture domain techniques 7.7 Comparative examples
7.1 Introduction The mapping technique
Techniques which store information in a 2D domain which is used during rendering to simulate textures.
Texture mapping The mainstream application
Reflection mapping Simulate ray tracing
7.1 Introduction Environment mapping
Add pseudo-realism to shiny animated objects by causing their surrounding environment to be reflected in them.
Color mapping Texture - does not mean controlling the micro-
facets of the objects controlling the value of the diffuse coefficients Shading changes as a function of the texture maps.
7.1 Introduction Three origins to the difficulties
How can we physically derive a texture value at a surface point if the surface does not exits.
How to map a 2D texture onto a surface that is approximated by a polygon mesh.
Aliasing problem
Possible ways to modulate a computer graphics model with a texture map Color
Modulate the diffuse reflection coefficients in the local reflection model.
Specular color (environment mapping) Special case of ray tracing
Normal vector perturbation (bump mapping) Applies perturbation to the surface normal according to the correspon
ding value in the map. Displacement mapping
Uses a height field to perturb a surface point along the direction of its surface normal.
Transparency Used to control the opacity of a transparent object
Ways to perform texture mapping Choice depend on
Time constraints Quality of the image required
We will restrict the discussion to 2D texture maps. (Heckberts 1986)
2D Texture mapping 2D-to-2D transform
2D texture object surface screen space
can be viewed as an image warping operation
Ways to perform texture mapping Forward mapping
Two stages process 2D texture space -> 3D object space
Parametrisation Associates all points in texture space with points on the object
surface 3D object space 2D screen space
Projective transform
Inverse mapping For each pixel we find its corresponding pre-image in text
ure space.
Two ways of viewing the process of 2D texture mapping
(a) Forward mapping (b) Inverse mapping
7.2 Two-dimensional texture maps to polygon mesh objects
7.2.1 Inverse mapping by bi-linear interpolation
7.2.2 Inverse mapping by using an intermediate surface
7.2.3 Practical texture mapping
7.2.1 Inverse mapping by bi-linear interpolation Inverse mapping
Consider a single transformation for 2D screen space (x,y) to 2D texture space (u,v). An image warping, can be modelled as a rational linear project
ive transform:
We can write this in homogeneous coordinates as :
The inverse transform If we have the association for the four vertices of a q
uadrilateral we can find the nine coefficients (a,b,c,d,e,f,g,h,i)
Bi-linear interpolation in screen space Assuming vertex coordinate/texture coordinate for all polygons we c
onsider each vertex to have homogeneous texture coordinates:
Use normal bi-linear interpolation scheme within the polygon, using homogeneous coordinates as vertices to give (u’,v’,q) for each pixel; then the required texture coordinates are give by:
zqqvvquuwhere
qvu
/1,/,/:
),,(
)/,/(),( qvquvu
7.2.2 Inverse mapping by using an intermediate surface Used when there is no texture coordinate-vertex coor
dinate correspondence. It can be used as a preprocess to determine the corres
pondence. Two-part texture mapping:
To overcome the surface parametrisation problem Introduced by Bier and Sloan (1986)
The intermediate surface must has an analytic mapping function.
Two-stage forward mapping process First stage : S mapping
2D texture space to 3D intermediate surface
Second stage : O mapping 3D texture pattern onto object surface.
),,(),( iii zyxTvuT
),,(),,( wwwiii zyxOzyxT
Two-stage forward mapping process
S mapping Bier describes 4 intermediate surfaces
A plane at any orientation The curved surface of a cylinder The faces of a cube The surface of a sphere
For example Given a parametric definition of the curve surface of a cylinder as a set
of points (,h)
c , d are scaling factors θ0 and h0 position the texture on the cylinder of radius r.
Four O mapping
Inverse mapping using the shrink wrap method
Inverse mapping using the shrink wrap method
Inverse mapping
Examples Examples of mapping the same texture onto an object using different
intermediate surfaces
7.2.3 Practical texture mapping
7.2.3 Practical texture mapping An example of a tank object texture being created from a photograph
of a tank
7.2.3 Practical texture mapping Interactive texture mapping-pain
ting in T (u,v) space
7.2.3 Practical texture mapping Agglomerating part maps into a single texture map.
7.3 Two-dimensional texture domain to bi-cubic parametric patch objects The parametrization is trivial
P (u,v) T (s,t) Catmull (1974)
Subdivide patch in object space, and at the same time subdivide corresponding texture in texture space.
Patch subdivision proceeds until it covers a single pixel Cook (1987)
Object surfaces are subdivided into micro-polygons and flat shaded with values from a corresponding subdivision in texture space
7.3 Two-dimensional texture domain to bi-cubic parametric patch objects Example
7.4 Bump mapping7.4.1 A multi-pass technique for bump mapping
7.4.2 A pre-calculation technique for bump mapping
7.4 Bump mapping Developed by Blinn in 1978 An elegant device that enables a surface to ap
pear as if it were wrinkled or dimpled without the need to model these depressions geometrically.
The only problem Silhouette edge that appears to pass through a dep
ression will not produce the expected cross-section
A one-dimensional example of the stages involved in bump mapping
The surface and its normal Assuming the surface is defined by a bivariate parametric fun
ction P(u,v) The surface normal on each point of the surface is then define
d as
Pu and Pv are the partial derivatives lying in the tangent plane to the surface at point P
vu PPv
P
u
PN
The displaced surface and it’s surface normal The new displaced surface P’(u,v)
Two-dimensional height field B(u,v) called bump map
The new surface normal on P’
NvuBvuPvuP ),(),(),(
vu PPN
The partial derivatives of P’ and the new surface normal on P’ The partial derivatives of P’
If B is small we can ignore the final term so N’ become:
D is a vector lying in the tangent plane that pull N into the desired orientation and is calculated from partial derivatives of the bump map and the two vectors in the tangent plane.
vvvv
uuuu
NvuBNBPP
NvuBNBPP
),(
),(
DN
BBABN
PNBPNBNN
or
NPBPNBNN
vu
uvvu
uvvu
)(
Geometric interpretation of bump mapping
7.4.1 A multi-pass technique for bump mapping McReynolds and Blythe (1997) define a multi-pass tech
nique. They split the calculation into two components. The fina
l intensity value is proportional to N’. L
First component : the normal Gouraud component Second component : found from the differential coefficient of t
wo image projections
LDLNLN
A multi-pass technique for bump mapping (cont.) To do this it is necessary to transform the light vector into t
angent space at each vertex of the polygon. This space is defined by N, B, T N is the vertex normal T is the direction of increasing u (or v) in the object space coordia
nte system B = N T
Normalised components of these vectors defines the matrix that transforms point into tangent space
1000000
zyx
zyx
zyx
TS NNNBBBTTT
L
A multi-pass technique for bump mapping (cont.) Algorithm is as follows
7.4.2 A pre-calculation technique for bump mapping Tangent space can also be used to facilitate a pre-calculation techni
que as proposed by Peercy et al. (1997) It can be shown that the perturbed normal vector on tangent space g
iven by
vu
vuuv
vu
TS
PPc
PTBPBb
PBBa
where
cba
cbaN
))((
)(
)(
,,2/1222
Example for bump mapping A bump mapped object with the bump map
Example for bump mapping A bump mapped object from a procedurally
generated height field.
Example for bump mapping Combining bump and color mapping
The bump and color map
7.5 Environment or reflection mapping 7.5.1 Cubic mapping 7.5.2 Sphere mapping 7.5.3 Environment mapping : comparative
points
7.5 Environment or reflection mapping Originally called reflection mapping
Suggested by Blinn (1977) Consolidated into mainline rendering techniques in an im
portant paper in 1986 by Greene Used to approximate the quality of a ray-tracer for sp
ecular reflections It is a classic partial offline or pre-calculation techni
que V Rv M(Rv)
7.5 Environment or reflection mapping
7.5 Environment or reflection mapping Example
Disadvantages Correct only when the object becomes small
with respect to the environment that contains it.
An object can only reflects the environment – not itself.
A separate map is require for each object. A new map is required whenever the view poi
nt changes
Environment mapping VS. ray tracing
Three methods for environment mapping Cubic mapping Latitude-longitude mapping sphere mapping
7.5.1 Cubic mapping
7.5.1 Cubic mapping A problem of a cubic map is
that if we are considering a reflection beam formed by pixel corners, or equivalently by reflected view vectors at a polygon vertex , the beam can index into more than one
map.
Cubic environment map convention
7.5.2 Sphere mapping Latitude-longitude projection
Blinn and Newell(1976) Rv T (u,v)
Main problem : singularities at the poles As Rvz +1,-1 both Rvx and Rvy 0 and Rvy/Rvx bec
ome ill-defined
7.5.2 Sphere mapping Haberli and Segal (1993) and Miller et al. (1998) To generate the map
To index into the map
Constructing a spherical map
7.5.3 Environment mapping : comparative points Sphere mapping requires only one map, while
cubic mapping needs six maps. Both type of sphere mapping suffer more
from non-uniform sampling than cubic mapping.
Sampling the surface of a sphere
7.6 Three-dimensional texture techniques
7.6.1 Three-dimensional noise
7.6.2 Simulating turbulence
7.6.3 Three-dimensional texture and animation
7.6.4 Three-dimensional light maps
7.6 Three-dimensional texture techniques Difficulties associated with mapping a 2D
texture onto the surface of a 3D object. The reasons for this are : Large variations in the compression of texture Textural continuity across surface elements
Mapping How to map object surfaces to texture space
3D to 3D mapping is straightforward, the problems in 2D texture mapping is eliminated
Texture coordinate assignment can be simple as straight mapping, u=x,v=y,w=z (u,v,w) is a coordinate in the texture field.
Presentation How to present the texture
layers of 2D iso-surfaces Limited resolution and take up vast memory Easily acquired through 3D layered scanning
procedural texture A method that define procedurally a texture field in object space. save storage space Limited use The color of the object determined by the intersection of its surfa
ce with the texture field Solid Texture (Perlin 1985, Peachey 1985)
7.6.1 Three-dimensional noise It is a popular class of procedural texturing te
chnique It uses a 3D noise function as a basic modelin
g primitive It can be used to produce a surprising variety
of realistic natural-looking texture effects
Algorithm generation of solid noise Perlin (1985) was the first to suggest this appl
ication of noise. Define a noise function noise() It is called model directed synthesis Evaluate the function only at points of interest
Noise function properties Ideally, the function should posses the followi
ng three properties Statistical invariance under rotation. Statistical invariance under translation. A narrow bandpass limit in frequency
The first two conditions ensures that no matter how we move or orientate the noise function in space its general appearance remains the same.
The third condition enables us to sample the noise function without aliasing
Perlin’s method of generating noise Define an integer lattice situated at location (i,j,k) Associate a random number with each point of the la
ttice The association can be done in two ways
A look-up table Via a hashing function
The value of the noise function at a point in space For the points on the lattice
The noise value is the associated random number For other points not on the lattice
The noise value can be obtained by linear interpolation from the nearby lattice points
Problems with Perlin’s method The function will tends to exhibit directional c
oherence Can be ameliorated by using cubic interpolation
Expensive The coherence still tend to be visible
Alternative methods Lewis (1989)
7.6.2 Simulating turbulence The most versatile of its applications is the use of the s
o-called turbulence function Takes a position x and returns a turbulent scalar value The 1D version defined as
turbulence (x)=
The summation is truncated at k which is the smallest integer satisfying < the size of a pixel
Exhibits self-similarity Power spectrum obeys a 1/f power law
k
ii
i xnoiseabs
0
)2
)2((
12
1k
Two stages in the process of simulating turbulence Representation of the basic, first order, structu
ral features of a texture through some basic functional form.
Addition of 2nd and higher order detail by using turbulence to perturb the parameters of the function.
Example : the marble The basic function form
marble(x) = marble_color(sin(x))
Adding turbulence marble(x)=marble_color(sin(x+turbulence(x))
Example : the marble
Remark The use of turbulence function need not be res
tricted to modulated just the color of an object Surface bumps
Oppenheimer(1986) Turbulates a sawtooth function to bump map the ridges of bark on the tree.
Transparency Density
7.6.3 Three-dimensional texture and animation Define turbulence function over time as well a
s space simply by adding an extra dimension representing time to the noise integer lattice. Lattice point indices (i,j,k,l) Noise function: noise (x,t)
Example : simulate fire Basic form: the flame shape
First define a flame region in the xy plane Flame color in this region is given by
)),()/((_)/1()( txturbulencebxabscolourflamehyxflame
Example : simulate fire The turbulated form
Flame (x,t) = (1-y/h) flame_colour(abs(x/b)+burbulence(x,t))
Convection flame(x,t) =
(1-y/h) flame_color(abs(x/b)+turbulence(x+(0,ty,0),t))
7.6.4 Three-dimensional light maps A method of caching the reflected light at eve
ry point in the scene. Store reflected light at a point in a 3D structur
e that represents object space The practical restriction is the cost of vast me
mory resources.
7.7 Comparative examples 7.7.1 Figure 7.23
7.7.2 Figure 7.24
7.7.3 Figure 7.25
7.7.1 Figure 7.23
7.7.2 Figure 7.24
7.7.2 Figure 7.24 Shadow and environment map
7.7.3 Figure 7.25