Texture = Arbitrary Illumination - PowerPoint PPT Presentation

About This Presentation
Title:

Texture = Arbitrary Illumination

Description:

Examples of usage: Paste a picture. picture of environment. picture of scene ... Other Texture Usage. Alpha Map. Transparent texture. Light Map ... – PowerPoint PPT presentation

Number of Views:108
Avg rating:3.0/5.0
Slides: 25
Provided by: sub8
Category:

less

Transcript and Presenter's Notes

Title: Texture = Arbitrary Illumination


1
Texture Arbitrary Illumination
  • Vary a surface property non-linearly
  • Rasterization does bi-linear interpolation
  • Examples of usage
  • Paste a picture
  • picture of environment
  • picture of scene
  • Modify surface normals
  • Create bumps and detail

2
Texture Mapping
  • Texture aka function of a surface
  • f (x,y,z) some attribute value
  • Would like f to be arbitrary
  • No continuity constraints
  • Look-up table is a possible implementation
  • But not all x,y,z has the surface through it
  • Surface is only a 2-manifold
  • 2D look-up table
  • But want to map every point on a surface to a 2D
    space ltu,vgt
  • parameterization

3
Texture Mapping
4
Texture Coordinates
5
Pixel Texture Coordinates
Triangle
Pixel
Screen
Texture
6
Pixel Texture Lookup
Texel
Pixel
7
Texture-Minification
Texels
Pixels
These texels should also contribute to the pixel
8
Mip-Mapping
  • Filter 2x2 texel blocks into one texel
  • Weighted average
  • Log(n) levels of an n xn texture map
  • Choose level closest to 1 texel/pixel
  • Pixel derivative

9
Derivative
Texels
Tex coord t0
t1
Pixels
WxH texture gt texel size 1/W x 1/H
x x
t1 t0 (?t u, ?t v )
t2 t0 (?tyu , ?tyv)
?t max (?txu , ?tyu), max(?txu , ?tyv)
Use divided difference t1 t-1
10
Anisotropic Filter
Texels
Pixels
Use Smallest minification May read several texels
11
Texture Border
  • Extra texel needed for linear interpolation

u 0
12
Other Texture Usage
  • Alpha Map
  • Transparent texture
  • Light Map
  • Diffused lighting independent of viewer
  • How do you generate it?
  • Texel to Object space reverse-mapping
  • Specular Map
  • Displacement Map
  • Bump Map
  • Environment Map
  • Point Sprites

13
Point Sprites
  • Draw points
  • E.g., as a k x k pixel square
  • Map a (small) texture on the point
  • Typically used with transparency
  • For example a cursor

14
Bump Mapping
15
Bump Mapping
  • Physically displace
  • Generate many triangles
  • Simulate
  • Change the normal
  • Normal affects lighting

N
16
Bump Mapping
  • Assume
  • Bump to the surface is small
  • In the direction of the normal
  • aka Height-map
  • Simulation

17
Bump Mapping
  • Tangent to the surface P(u,v) at a point (u,v)
    Pu, Pv
  • The normal is then
  • N(u,v) Pu ? Pv
  • P'(u,v) P(u,v) B(u,v) N
  • P'u Pu Bu N B Nu ? P'u Pu Bu N
  • P'v Pv Bv N B Nv ? P'v Pv Bv N
  • (if B is small)
  • P'u x P'v
  • Pu ? Pv Bu(N ? Pv) - Bv(N ?
    Pu) Bu Bv(N ? N)

18
Bump Mapping
  • N'(u,v)
  • Pu ? Pv Bu(N ? Pv) - Bv(N ? Pu) Bu Bv(N
    ? N)
  • N Bu(N ? Pv) - Bv(N ? Pu)
  • ? N - BuPu BvPv
  • if tangents are almost perpendicular
  • Note
  • Store Bu and Bv as
  • 2-component texture
  • Normalize N

D
N
N
19
Normal Mapping
  • Directly store the new normal per texel
  • From bump map
  • Nx (0, 1, Bu)
  • Ny (1, 0, Bv)
  • N Nx X Ny
  • Remember to normalize
  • (and range compress)

20
Displacement Mapping
  • Modifies the surface position
  • Along surface normal, typically
  • Use if Bumps are large
  • Get silhouettes, shadows right
  • Much more expensive
  • Tessellate geometry
  • Some support in modern GPUs

21
Environment Mapping
  • Global Illumination
  • For each point on the surface
  • Render the entire scene
  • Pick pixels in useful directions
  • Environment Map
  • Assume high gloss
  • Find ideal reflected direction
  • Look-up the value in that direction
  • Use one rendering
  • Eye at the center of the object
  • Where is the image plane?
  • Introduces distortions in the reflection
  • Good for small objects in a large room

Reflected direction
22
Example
23
Cube Mapping
  • Map onto surfaces of a cube (around the object)
  • Axis-aligned often
  • Find desired direction from a surface point
  • Cube map accessed by the direction
  • One of the six faces of the cube intersects
  • The corresponding texture is looked up
  • For environment mapping
  • Render scene from object-center onto cube face
  • Use, e.g, the six axis-aligned directions
  • Rendering may be pre-computed at high quality
  • E.g., 6 photos of a real environment

24
Cube Map Example
Write a Comment
User Comments (0)
About PowerShow.com