Bump-Map (*)
texture in charge of providing an illusion of a hi- freq geometrical detail
(not modeled in the mesh)
recall: mesh can only be low-res (low-poly)
not much detail in it, usually
aka “Texture-for-Geometry”
much cheaper to render/store than real geometry!
details may extrudeoutor be encarvedin the mesh surface
usually: this affects lighting only
sufficient to trick the eye!
especially with dynamic lighting
(*) Terminology not universally adopted…
Often, with «bump-map» is intended the solely «displacement map», or other types
Bump-Map
From the modeler perspective:
macro-structureof the object low-poly mesh
e.g.: the general shape of the horse
e.g.: the general shape of the face
e.g.: the general shape of the dragon
meso-structure of the object bump-map
e.g.: the musculature of the horse
e.g.: the wrinkles of the face
e.g.: the flakes of the dragon
Bump maps:
Categories
Bump maps
Displacement maps
Normal maps
Scalar Vectorial Object
Space Tangent
Space most common
Bump-Mapping
see demo!
+ =
Low-poly mesh
(uv-mapped!)
Bump-map
(here: a tangent space normal map)
lots of cheap geometric detail
(apparently)
Low-poly mesh Bump-map
Bump maps:
Categories
Bump map:
Any texture that encodes hi-freq details (“meso-structure”) on a low-res surface
Displacement Map
Details encoded by storing the differences between low-res and hi-freq
As scalars(distance along the normal) or as vectors
Used for re-tessellation, or for parallax mapping
Normal Map:
Details encoded by storing the normals of the hi-freq surface
Modifying the lighting
In which space (in which vectorial base)?
Tangent Space: (TBN space)
Reusable on more surfaced independently from the orientation
Required Tangent-Bitangent direction (and normals) def. on surface
Object Space:
Only for 1:1 UV-mapping
Displacement map (scalar):
concept
Store the Distancesof the detailed surfaces from the low-poly mesh
example -- a bump-map for a screw-head :
Detailed surfaces (I would like to model) head of the screw
low-poly mesh
0.2 0.6 0.4
Displacement map (scalar):
note
Each texel:
distanceof the described surface
Along the normaldirection
(of low-poly mesh)
1 scalarper texel – 1 channel texture
Way:
outwards (extrusion)
inwards (excavation)
both
Positive values: extrusion
Negative values: excavation inwards
Storage:
gray-scale image
(1 scalar per pixel)
Remap values within the interval [0..1]
Uses:
Direct, approximated lighting?
“embossing” effect
Global illumination computation (ambient occlusion)
Intermediate data for the construction of a normal map
white = upwards black = downwards
We will see
Easy to paint and Manipulate!
Practically, An height field def. on sur. of the mesh
Vectorial displacement map : concept
Store Vectorsfrom the low-poly mesh to the detailed surfaces
Detailed surface (I would like to model)
low-poly mesh
(approx. of ^) (here: flat )
displacement map (vectorial)
“subsquare”!
Not an height field
More expressive variant, but more expensive and less usable Not widely used (in games).
½ · + ½·( 1- ) = lighting
Displacement map (scalar):
Rendering – embossing effect
Displ.-map Displ.-map
(approximated)
shifted: !
Approx. too rough:
non used anymore (in games)
Image processing method
for approximating the lighting onto a (scalar) displacement map
concept:
finite differences : approximate 2D gradient
approximate (X,Y) normal surface approximate lighting
(scalar) Displacement map:
Rendering – parallax mapping
Technique used to simulate the parallax effect
(onto a scalar Displacement Map)
We will see it in the lecture on rendering
Normal Map:
concept
Store the Normalsof the detailed surfaces
example -- a normal-map for a screw-head :
Detailed surface (I would like to model) head of the screw
low-poly mesh
(approximation of ^) (here: flat )
normal map
(one normal per texel)
Normal Map:
note
Modify the lighting
nonthe parallax
nonthe shape of the object
The lighting reflects the hi-freq detail of the object
dynamically (with variable lights!)
Total illusion: very convenient
If we are not trying to model a macro-structure
In rendering: use the normal from the texture
(for lighting)
Instead of the interpolated per vertex normal
Normals are expressed in cartesian coord
Often
But not always (∃ better ways to express unit vectors!)
Question: ok, but in which space??? more later
Normal Maps: in which space do I express the norm?
Object space: Object-Space Normal-Maps (The same in which I express the vertex pos)
the normal per vertex becomes unnecessary!
(The normal from texture is enough!)
Trivial in rendering phase
normal map bounded to a specific object
I don’t reuse the normal map on different objects
Each region of the normal map is bounded to responsible region of the object!
Only injective mappings!!!
e.g. no tiling, no exploitation of simmetries
Normal Maps: in which space do I express the norm?
Intuition:
It would be more pratical defining the normals wrt texture space:
X: right way of the texture
Y: down way of texture
Z: orthogonal wrt texture plane
but, How to bring this space onto the 3D model
3D?
Tangent space (aka TBN space)
Vector space defined ∀ point of the surface:
Z axis: Normal
(from surface)
X and Y axis: tangent vector
(to the surface)
X = Tangent
Y = “Bi-Tangent”
(sometimes, but inappropriately: “Bi-Normal”)
stored: per vertex on the mesh
As attribute interpolated from the rest of the surface
Possible to optimze! Not necesessarly 3 vectors
Tangent space (aka TBN space)
How do I compute them?
Normal
as usual (see lec. on mesh)
Tangent &Bi-Tangent
Computable from UV mapping!
They are the gradientof U coord and V coord respectively.
(Implementation detail:
calculate per face, avarage per vertex)
Notes:
Not necessarely exactly orthonormal
left-handed or right-handed, even in the same mesh
riquires discontinuities seams (The same of UV mapping? non only! why?)
Normal Maps: in which space do I express the norm?
Tangent space: Tangent Space Normal-Maps (bump-maps by default, in games)
extra attributes are needed per vertex:
Normale direction
Tangent direction
Bitangent direction
normal map sharable for more objects
normal map with UV-mapping also non-injective
e.g. tileable
e.g. Exploitation of simmetries
normal map constructable regardless from the object
Starting from a displacement map
The tangent space
(its storage can be optimzed, not necess. 3 vectors)
Normal Maps: in which space do I express the norm?
Tangent space: Tangent Space Normal-Maps (bump-maps by default, in games)
extra attributes are needed per vertex:
Normale direction
Tangent direction
Bitangent direction
normal map sharable for more objects
normal map with UV-mapping also non-injective
The tangent space
pratically, the normal map specifies how to modifythe normal sotred per vertex, instead of overwrite it
Mesh GPU Object
LOAD
Tangent Directions (B+T) as per vertex attributes
DISK (ROM) CENTRAL RAM GPU RAM
PREPROCESS:
COMPUTE TANGENT DIRS
Mesh Object
IMPORT
Mesh File
Stored into asset mesh, or computed after import:
WITH TANGENT DIRS
(per vertex)
Normal-maps:
Storage
Idea:
as RGB texture
RX
GY
BZ
but X,Y,Z∈ [-1,+1] and R,G,B∈ [0,+1]
thus remapping is necessary:
Advantage: same compression of RGB textures/images
+1
-1 0
1.0
0.0
X∈ ∈ R
X = 2 R – 1 R = ½ (X + 1 )
(normals = unitvectors)
Normal-maps:
Storage
Examples:
case
tangent space normal-map
Normal prevailing: X=~0 , Y=~0 , Z=~1
color prevailing: R=~0.5 , G=~0.5, B=~1 ( ~light blue)
Per e.g.: Tiled
(tangent space) Normal Maps
+ =
It wouldn’t be possible with object space NM
Bump-maps assets at a glance
(can you tell which is which?)
Object Space Normal map Tangent Space
Normal map
Displacement Map (scalar)
the default kind
Note
Object Space Normal map UV-mapping 1:1
right leg !=
left leg
(Tangent Space) Normal map UV-mapping NOT injective
Exploited symmetries!
Normal maps:
How are they obtained (1/4)
From displacement maps!
Displacement map come grayscale
= extruded - outwards
= deep – build in
Filter (e.g.
photoshop) 2D texture
painter / etc
Normal map
see demo!
Normal maps:
How are they obtained (1/4)
From: displacement map a: normal map
algorithm:
∀ texel t of displacement map
note: for each texel corresponds a 3D point (x , y , z = height[x,y])
compute best fitting plane
Plane that minimizes the distance of the points of the 3x3 texel centered on t
Simple quadratic minimizatin problem
or 5x5, or 7x7…
Normal maps:
how are they obtained (2/4)
Photometric Stereo
(a form of “inverse lighting”)
from: N real images (N>=4)
Same viewpoint
Different illumination
(possibly, controlled and known)
a Normal Map
in visual space!
convert in object space, or TBN
Normal maps
how are obtained? (3/4)
Normal-Painting on the model
(e.g. with Z-brush, Sculptris Alpha…)
Similar to a painting of diffuse maps
but painting of geometric details
similar to sculpting
But the system directly writes the normals, not the geometry
Normal maps
how are they obtained (4/4)
Detail recovery
“detail texture” synthesis baking of textures
from:
1) mesh Hi-Res
2) mesh Low-res + UV mapping (without repetitions)
to:
Normal map for 2
(that mimics the detail present in 1)
Detail texture synthesis (aka detail preservation)
Idea:
input:
a low res mesh A, with (injective) UV-map
a hi-res mesh B
with per vertex attributes
output:
a texture for A
capturing the vertex attributes in B
normals? a normal map is produced
(in object space, convert to TBN if necessary)
e.g.: A obtained from B through automatic simplification
Modelling + Texturing:
Pipeline production example
Concept drawings
2D artists
Low-poly model A
3D modeler, low poly editing tools
(Injective) UV-mapping of A
UV-mapper, or automatic tool, to build UV-map for A
Subdivision, digital sculpting of Hi-Res model B
3D modeler, digital sculpting
Painting over B
per vertex painting
Detail Recovery:
Automatic construction of Textures for A with attributes from B:
Normals from B, (normal map)
Colors from B (diffuse map)
Baked lighting from B (light-map)
M a r c o T a r i n i ‧ [ G A M E - D E V ] ‧ V e r o n a ‧
hi-res mesh
low res mesh
automatic simplification
still low-res, but textured!
rendering
TEXTURE Made up (e.g.. BumpMap
normals or RGB map x colors) detail
recover
M a r c o T a r i n i ‧ [ G A M E - D E V ] ‧ V e r o n a ‧ 2 0 1 3
simplification
2K triangles
original
500K triangles
Simplified but with texture
2K triangles
Detail Recovery: how to
Hi-res model Low-res
model
Texture map v
find a suitable spot find a suitable spot