Texture mapping - other methods Environmental mapping Bump mapping

25
CSE 681 Texture mapping - other methods Environmental mapping Bump mapping

description

Texture mapping - other methods Environmental mapping Bump mapping. Review Surface Texturing. u,v mapping: map 3D point within 3D surface Quadrilateral: inverse bi-linear mapping Spherical: e.g. lattitude-longitude Triangulated: barycentric coordinates Mip-mapping: pre-filter texture map - PowerPoint PPT Presentation

Transcript of Texture mapping - other methods Environmental mapping Bump mapping

Page 1: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Texture mapping - other methodsEnvironmental mapping

Bump mapping

Page 2: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Review Surface Texturing

• u,v mapping: map 3D point within 3D surface– Quadrilateral: inverse bi-linear mapping– Spherical: e.g. lattitude-longitude– Triangulated: barycentric coordinates

• Mip-mapping: pre-filter texture map– Average texels, reduce resolution– Index into appropriate map based on projected

pixel size

Page 3: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Environmental MappingReflect the environment off an object

Procedurally

• Reflection_color = f(R(u,v))

Table look-up

• Reflection_color = table(R(u,v),R(u,v))

Use normal to index into texture that represents the environment

Page 4: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Procedural Environmental Mapping

• Simple: ray up is blue, ray down is brown

• Complex: compute fractal intersection

• Medium: use sinusoidals to interpolate between gray and silver for a chrome effect

Page 5: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Environmental (table-based) Mapping

• Use pre-constructed enclosing volume containing projected environment

• Hemi-cube or hemisphere

• Mip-mapping possible

Page 6: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Environmental Mappingtable construction by projection

Page 7: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Hemi-cube projection construction method

Page 8: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Hemi-cube image construction method

Use pictures - of sky, mountains, buildings, etc.

Page 9: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Hemi-cube reflectance look-up

Page 10: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Examples

Page 11: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Examples

Page 12: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Examples

Page 13: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Examples

Page 14: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Examples

Page 15: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping

• Modulate normals over surface to create visual effect of geometric detail

http://www.mpi-inf.mpg.de/departments/irg3/ws0506/cg/slides/13-Texturing.pdf

Page 16: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping1. Use grey-scale image to define height field

2. Compute gradient of height field

3. Use gradient vectors to modify normal

• Don’t really modify surface geometry – just pretend we do by modifying normal

Page 17: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping

||),(),(),('N

NvuBvuOvuO

Surface is displaced in direction of normal according to displacement in bump table, B(u,v)

O(u,v) B(u,v) O’(u,v)

+ =

Page 18: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping Normal Vector

O(u,v) B(u,v) O’(u,v)

+ =

Display:

Page 19: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping

Page 20: Texture mapping - other methods Environmental mapping Bump mapping

Bump Mapping Normal Vector

vu OOvuN ),(

Page 21: Texture mapping - other methods Environmental mapping Bump mapping

Bump Mapping Normal Vector

v

vvv

u

uuu

N

NvuB

N

NvuBvuOvuO

N

NvuB

N

NvuBvuOvuO

||),(

||),(),(),('

||),(

||),(),(),('

||),(),(),('N

NvuBvuOvuO

vu OOvuN ),(),('),('),(' vuOvuOvuN vu

Page 22: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping Normal Vector

),('),('),(' vuOvuOvuN vu

Assume B is small - too small to deal with

v

vvv

u

uuu

N

NvuB

N

NvuBvuOvuO

N

NvuB

N

NvuBvuOvuO

||),(

||),(),(),('

||),(

||),(),(),('

Page 23: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping Normal Vectorvu OOvuN ),(

),('),('),(' vuOvuOvuN vu

2||||||),('

N

NNBBO

N

NBO

N

NBOOvuN vuuvvuvu

= N = 0= D(u,v)

||),(),(),('

||),(),(),('

N

NvuBvuOvuO

N

NvuBvuOvuO

vvv

uuu

Page 24: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump mapping examples

Page 25: Texture mapping - other methods Environmental mapping Bump mapping

CSE 681

Bump Mapping Example