1 / 29

Texture

Texture. Visual detail without geometry. Texture Mapping. desire for heightened realism. Texture Mapping. Means of adding visual detail to a scene without adding geometric detail

rhett
Download Presentation

Texture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Texture Visual detail without geometry

  2. Texture Mapping • desire for heightened realism

  3. Texture Mapping • Means of adding visual detail to a scene without adding geometric detail • For each point on the surface, there is a corresponding point in a texture image: fetch surface characteristics from the texture • Characteristics can be color, lighting parameters, surface normal, displacement

  4. Texture Definitions • Regular speech: conventional definition – visual and tactile properties of a surface • Graphics: operational definition – any image used in texture mapping • Vision: mathematical definition – a signal with the property of 'stationarity' (any part is like another part)

  5. Stationarity

  6. Stationarity

  7. Stationarity

  8. Texture Mapping • Cover a surface with an image • Each point has a texture coordinate (u,v) • Typically, the texture coordinates are given at vertices and interpolated like other parameters

  9. Texture Mapping • Simplest object: cylinder (sides only) • u coordinate is angle (normalized to 0..1) • v coordinate is height (normalized ditto) • "label on a can of soup" • Not all shapes can be parameterized so easily

  10. Texture Mapping • Map a 2D surface (in 3D) to a plane • On the one hand – no problem! The plane is big enough • On the other hand -- we want to satisfy constraints: • no distortion of areas • no distortion of angles • no seams • Impossible!

  11. Solutions • Remove one or more of the constraints: • Allow angles to be distorted • Allow areas to be distorted • Allow seams • Change the problem • Make a mapping from a surface to a surface • Make a mapping from a volume to a surface

  12. Relaxing Constraints • Usual solution – just put up with distortion • A little bit of distortion is not too visible • Allow distortion, but use it: the planar texture is pre-distorted

  13. Relaxing Constraints • Permit seams • Instead of a single "chart", we have a whole "atlas" – the surface is locally flat, so this can work • Need to hide the seams • easy if texture has lots of high-frequency detail • align seams with model features (e.g., hairline) • put seams in rarely-seen locations

  14. Solid Texture • Instead of a 2D plane, use a 3D volume of texture • Mapping is trivial • Object appears to be carved from textured material • Drawback: way more texture needed

  15. Solid Texture

  16. Traditional Texture Mapping • Specify (u,v) coordinates for vertices • (u,v) in ({0,1},{0,1}) – canonical values • Need to specify various characteristics of using the texture • what to do with coordinates outside range • how to combine texture and lighting • mip mapping

  17. Boundary Conditions • One-dimensional texture for simplicity • What does T(1.1) evaluate to? • Three options: • clamp: T(t) = T(1), t>1 • mirror: T(t) = T(1-t), 2>t>1 • repeat: T(t) = T(floor(t)) • May introduce visible discontinuities

  18. Combining Texture and Lighting • Texture supplies a color (value in texture map) • Illumination calculation also supplies a color (calculated by local lighting) • Combining them: • use texture only ("decal") • use constant fraction of texture • modulate (multiply values together)

  19. Bump Mapping • Jim Blinn, 1981 • Modify normal direction according to texture • No extra geometry, illusion of high geometric complexity • N = Ninterpolated* (1-b) + b * Ntexture • and renormalize

  20. Normal Maps • No underlying normal to perturb – entire normal comes from texture • No 3D geometry needed! Can give illusion of geometry on sprites (just use fake normal in lighting calculation)

  21. Magnification and Minification • Texture rarely appears onscreen at the stored resolution • If it appears smaller: minification filtering • If it appears larger: magnification filtering • Filtering options: • nearest neighbour • linear interpolation • cubic interpolation (smoother, more expensive)

  22. MIP mapping • "multum in parvo", "many [things] in a small place" • Store multiple prefiltered scales of texture • Prefiltering done ahead of time, with great care, reducing aliasing and preserving important features • Interpolate between mipmap levels instead of filtering

  23. the TextureSampler • In HLSL, reading a value from a texture is done with the TextureSampler • auxiliary function defined in shader • specifies what interpolation to use • given coordinates, returns texture value (color) • Shader interprets texture • used for color, normal (bump mapping), position (displacement mapping) , ...

More Related