Texture mapping World/object coordinates 2D/3D Sources : scanners, - - PowerPoint PPT Presentation

texture mapping world object coordinates 2d 3d sources
SMART_READER_LITE
LIVE PREVIEW

Texture mapping World/object coordinates 2D/3D Sources : scanners, - - PowerPoint PPT Presentation

Texture mapping World/object coordinates 2D/3D Sources : scanners, raytracers Mapping one object pixel to a texture pixel Object parameterization Planar map shape Planar map shape Planar map shape Cylindrical map shape Cylindrical map


slide-1
SLIDE 1
slide-2
SLIDE 2

Texture mapping

slide-3
SLIDE 3

World/object coordinates

slide-4
SLIDE 4

2D/3D

slide-5
SLIDE 5

Sources : scanners, raytracers

slide-6
SLIDE 6

Mapping one object pixel to a texture pixel

slide-7
SLIDE 7

Object parameterization

slide-8
SLIDE 8

Planar map shape

slide-9
SLIDE 9

Planar map shape

slide-10
SLIDE 10

Planar map shape

slide-11
SLIDE 11

Cylindrical map shape

slide-12
SLIDE 12

Cylindrical map shape

slide-13
SLIDE 13

Cylindrical map shape

slide-14
SLIDE 14

Spherical map shape

slide-15
SLIDE 15

Spherical map shape

slide-16
SLIDE 16

Spherical map shape

slide-17
SLIDE 17

Cube map shape

slide-18
SLIDE 18
slide-19
SLIDE 19

Cube map shape

slide-20
SLIDE 20

What do we get from the texture?

slide-21
SLIDE 21

Parametric patches

slide-22
SLIDE 22

Parametric patches

slide-23
SLIDE 23

Parametric patches

slide-24
SLIDE 24

Parameterized cube

slide-25
SLIDE 25

Non-linear mapping

slide-26
SLIDE 26

Triangular meshes

  • One texture coordinate per vertex
  • Regular parameterization of the mesh
  • Requirements:

– Continuous – Small angular deformations – Small area deformations – Covers the entire mesh – In practice: at most two

slide-27
SLIDE 27

Triangular mesh example

slide-28
SLIDE 28

Singularities (poles)

slide-29
SLIDE 29

Bump mapping

slide-30
SLIDE 30

Examples

slide-31
SLIDE 31

Bump mapping

  • Input = normal map (nx, ny, nz)
  • Local frame:

– z = geometric normal – x,y = tangent, bitangent

Follow the texture coordinates!

slide-32
SLIDE 32

Bump mapping

  • Example : note how blue (z) is dominant
slide-33
SLIDE 33

Bump mapping

  • Shading normal : local frame
  • Light, eye: global frame
  • Move everything to the same frame
  • [TBN]: transformation matrix

– To inverse, or not to inverse?

  • Note:

– textures in [0,1]3 – normals in [-1,1]3

slide-34
SLIDE 34

Bump mapping

slide-35
SLIDE 35

Displacement mapping

slide-36
SLIDE 36

Displacement mapping: how?

  • Not in the fragment shader

– Except towards the inside? – Candidate for tesselation shader

  • Easier with other rendering methods

– ray-tracing

slide-37
SLIDE 37

Relief textures

  • displacement mapping extreme case
slide-38
SLIDE 38

Relief textures

  • How?
  • Warp textures before mapping
  • Or follow rays in a height field
  • Polygons = convex hull
slide-39
SLIDE 39

Environment mapping

slide-40
SLIDE 40

Raytracing/Env. mapping

slide-41
SLIDE 41

Raytracing/Env. mapping

slide-42
SLIDE 42
slide-43
SLIDE 43

Environment mapping

  • Texture = distant light
  • Parameterization: cube, sphere
  • Incoming ray + reflection = outgoing ray
  • Query texture in this direction
slide-44
SLIDE 44

Environment mapping

Example environment map (spherical parameterization)

slide-45
SLIDE 45

Environment mapping

slide-46
SLIDE 46

Environment mapping

  • Can also work with refracted rays
  • Only one interface

– huge approximation

slide-47
SLIDE 47

Environment mapping

slide-48
SLIDE 48

Environment mapping

slide-49
SLIDE 49

Aliasing

slide-50
SLIDE 50

Under-sampling

slide-51
SLIDE 51

Need pre-filtering

slide-52
SLIDE 52

Multiple samples per pixel

slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57
slide-58
SLIDE 58

Aliasing

  • Texture + distance = aliasing

– Looks bad – Multi-sampling is not enough

  • Color textures: can pre-filter
  • Normal maps, height maps:

– Pre-filtering doesn’t make sense – Open research problem

slide-59
SLIDE 59

3d textures

slide-60
SLIDE 60

3D parameterization

slide-61
SLIDE 61

Examples: distance to a plane

slide-62
SLIDE 62

Distance to a line

slide-63
SLIDE 63

Color ramps, sinus…

slide-64
SLIDE 64

Color-table

slide-65
SLIDE 65

Noise is useful

slide-66
SLIDE 66
slide-67
SLIDE 67
slide-68
SLIDE 68
slide-69
SLIDE 69

Simplex noise

  • Same as gradient noise
  • Use a simplex instead of a cube
  • 3D: tetrahedron + gradient interpolation
  • Underlying structure is invisible

http://en.wikipedia.org/wiki/Simplex_noise

slide-70
SLIDE 70

Frequency

8 16 32

slide-71
SLIDE 71

5 octaves together

Persistence = 0.5

slide-72
SLIDE 72

5 octaves together

Persistence = 0.2

slide-73
SLIDE 73

Noise

  • Parameters :

– Number of octaves – Amplitude of first octave – Persistence: ratio amplitude octaves

  • Geometric sequence

– Lacunarity: ratio of octave periods

slide-74
SLIDE 74

Noise

  • Often compared to salt in cooking
  • Only noise: not very good
  • 3D textures without noise: a bit bland
  • Combination textures 3D + noise

– Really interesting

slide-75
SLIDE 75

Procedural textures

slide-76
SLIDE 76

Perturbations

slide-77
SLIDE 77
slide-78
SLIDE 78
slide-79
SLIDE 79
slide-80
SLIDE 80
slide-81
SLIDE 81
slide-82
SLIDE 82

Procedural textures + noise

  • Not limited to color
  • Normals, material parameters...
  • Regular structure + a bit of noise

– Wood, bricks, floor tiles...

  • Filtering / anti-aliasing : harder, but

necessary

slide-83
SLIDE 83

Procedural textures for object definition

slide-84
SLIDE 84

All together...