TEXTURE MAPPING SAUMITRA BAGCHI DEFINITION Texture: T he feel, - - PowerPoint PPT Presentation

texture mapping
SMART_READER_LITE
LIVE PREVIEW

TEXTURE MAPPING SAUMITRA BAGCHI DEFINITION Texture: T he feel, - - PowerPoint PPT Presentation

TEXTURE MAPPING SAUMITRA BAGCHI DEFINITION Texture: T he feel, appearance, or consistency of a surface or a substance. DEFINITION Texture mapping is a method for adding detail, surface texture (a bitmap or raster image), or color to a


slide-1
SLIDE 1

TEXTURE MAPPING

SAUMITRA BAGCHI

slide-2
SLIDE 2

DEFINITION

Texture:

The feel, appearance, or consistency

  • f a surface or a substance.
slide-3
SLIDE 3

DEFINITION Texture mapping is a method for adding detail, surface texture (a bitmap or raster image), or color to a computer-generated graphic or 3D model.

slide-4
SLIDE 4

WHY DO WE NEED TEXTURE MAPPING

Because objects look fake and boring without it

slide-5
SLIDE 5

ADDING TEXTURE IMPROVES REALISM

slide-6
SLIDE 6

THE LIMITS OF GEOMETRIC MODELING

Although graphics cards can render over 10 million polygons per second, that number is insufficient for many phenomena

  • Clouds
  • Grass
  • Terrain
  • Skin
slide-7
SLIDE 7

MODELING AN ORANGE

  • Consider the problem of modeling an orange (the fruit)
  • Start with an orange-colored sphere
  • Too simple
  • Replace sphere with a more complex shape
  • Does not capture surface characteristics (small dimples)
  • Takes too many polygons to model all the dimples
slide-8
SLIDE 8

MODELING AN ORANGE

  • Take a picture of a real orange, scan it, and “paste” onto

simple geometric model

  • This process is known as texture mapping
  • Still might not be sufficient because resulting surface will

be smooth

  • Need to change local shape
  • Bump mapping
slide-9
SLIDE 9

GOALS WITH TEXTURING

  • adding per-pixel surface details without raising the geometric

complexity of a scene

  • keep the number of vertices and primitives low
  • add detail per fragment
  • modelling and rendering time is saved by keeping the

geometrical complexity low

slide-10
SLIDE 10

TYPES OF MAPPING

Texture Mapping

  • Uses images to fill inside of polygons

Environment (reflection mapping)

  • Uses a picture of the environment for texture maps
  • Allows simulation of highly specular surfaces

Bump mapping

  • Emulates altering normal vectors during the rendering process process
slide-11
SLIDE 11

TEXTURE MAPPING

Instead of calculating color, shade, light, etc. for each pixel we just paste images to our

  • bjects in order to create the illusion of

realism

slide-12
SLIDE 12

TEXTURE MAPPING

Mapping a 2D Texture onto a 3D Object Using a UV Map

  • stretching a 2D texture over the surface of a 3D shape
  • The answer to that is a technique called UV Mapping
slide-13
SLIDE 13

TEXTURE MAPPING

  • 3D space defined by (x, y, z) coordinates
  • We want to take a 2D square texture and map it onto
  • ur 3D geometry
  • 2D coordinate system on top of the texture,

with (0,0) in the bottom left and (1,1) in the top right.

  • we’ll call these 2D textures coordinates by the

letters (u, v), which is where the name UV mapping comes from.

slide-14
SLIDE 14

TEXTURE MAPPING

  • Let’s create a texture now to help us visualize this.

We’ll use a simple black and white checker pattern and label a few of the UV coordinates. Once we are done, we’ll have something that looks like this:

  • UV mapping is the process by which we map

2D (u,v) coordinates onto 3D (x, y,z) coordinates: (u,v)⟶(x,y,z)

slide-15
SLIDE 15

TEXTURE MAPPING

In the figure below, we’re showing how we want the texture to map onto the front face of the cube.

We’ve also drawn in the (x, y, z) coordinates of the vertices of this face, so we can see that we want this mapping from UV coordinates to 3D coordinates:

(0,0)⟶(-1,-1,1) (0,1)⟶(-1,1,1) (1,1)⟶(1,1,1) (1,0)⟶(1,-1,1)

slide-16
SLIDE 16

TEXTURE MAPPING

slide-17
SLIDE 17

ENVIRONMENT (REFLECTION MAPPING)

  • Is an efficient image based

lighting technique

  • Approximating the appearance of a reflective

surface by means of a precomputed texture image.

slide-18
SLIDE 18

BUMP MAPPING

  • Is a technique in computer graphics for simulating

bumps and wrinkles on the surface of an object

  • This is achieved by perturbing the surface normals of

the object and using the perturbed normal during lighting calculations

slide-19
SLIDE 19

WHERE DOES MAPPING TAKE PLACE?

Mapping techniques are implemented at the end of the rendering pipeline

slide-20
SLIDE 20

IS IT SIMPLE?

Although the idea is simple---map an image to a surface---there are 3 or 4 coordinate systems involved

slide-21
SLIDE 21

COORDINATE SYSTEMS

  • Parametric coordinates
  • May be used to model curves and surfaces
  • Texture coordinates
  • Used to identify points in the image to be mapped
  • Object or World Coordinates
  • Conceptually, where the mapping takes place
  • Window Coordinates
  • Where the final image is really produced
slide-22
SLIDE 22

TEXTURE MAPPING

slide-23
SLIDE 23

MAPPING FUNCTIONS

  • Basic problem is how to find the maps
  • Consider mapping from texture coordinates to

a point a surface

  • Appear to need three functions
  • x = x(s,t)
  • y = y(s,t)
  • z = z(s,t)
  • But we really want to go the other way
slide-24
SLIDE 24

BACKWARD MAPPING

We really want to go backwards

  • Given a pixel, we want to know to which point on an object it

corresponds

  • Given a point on an object, we want to know to which point in the

texture it corresponds Need a map of the form

  • s = s(x,y,z)
  • t = t(x,y,z)
slide-25
SLIDE 25

TWO-PART MAPPING

  • One solution to the mapping problem is to first map

the texture to a simple intermediate surface

  • Example: map to cylinder
slide-26
SLIDE 26

CYLINDRICAL MAPPING

parametric cylinder x = r cos 2π u y = r sin 2πu z = v/h maps rectangle in u,v space to cylinder of radius r and height h in world coordinates s = u t = v maps from texture space

slide-27
SLIDE 27

NON-PARAMETRIC TEXTURE MAPPING

  • With “non-parametric texture mapping”
  • Texture size and orientation are fixed
  • They are unrelated to size and orientation
  • f polygon
slide-28
SLIDE 28

PARAMETRIC TEXTURE MAPPING

With parametric texture mapping, texture size and orientation are tied to the polygon:

  • Separate texture space and screen space
  • Texture the polygon as before but in texture space
  • Deform (render) the textured polygon into screen space
slide-29
SLIDE 29

TEXTURE MAPPING IN OPENGL

  • Three steps to applying a texture
  • 1. specify the texture

– read or generate image – assign to texture – enable texturing

  • 2. assign texture coordinates to vertices

– Proper mapping function is left to application

  • 3. specify texture parameters

– wrapping, filtering

slide-30
SLIDE 30

TEXTURE MAPPING

slide-31
SLIDE 31

TEXELS

A texel, texture element, or texture pixel is the fundamental unit of texture space, used in computer graphics. Textures are represented by arrays of texels, just as pictures are represented by arrays of pixels.

slide-32
SLIDE 32

IMPLEMENTING TEXTURE MAPPING

  • A texture lives in it own abstract image coordinates parameterized by (u,v) in

the range ([0..1], [0..1]):

  • It can be wrapped around many different surfaces:
  • Computing (u,v) texture coordinates in a ray tracer is fairly
  • Note: if the surface moves/deforms, the texture goes with it.
slide-33
SLIDE 33

ANTI-ALIASING

  • Aliasing is the distortion produced

by representing a high resolution signal at a lower resolution

  • Anti-aliasing aims to remove this

distortion

slide-34
SLIDE 34

REFERENCES

https://en.wikipedia.org/wiki/Texture_mapping https://discoverthreejs.com/book/1-first-steps/4-textures-intro/ http://www.cim.mcgill.ca/~langer/557/16-slides.pdf http://www.inf.ed.ac.uk/teaching/courses/cg/lectures/slides8.pdf https://www.cs.utexas.edu/users/fussell/courses/cs384g-fall2011/lectures/lecture12-Texture_mapping.pdf http://tume-maailm.pri.ee/ylikool/ComputerGraphicsSeminar/2018/spring/slides/Texturing%20- %20Rauno%20N%C3%A4ksi.pdf http://courses.cs.vt.edu/~cs4204/lectures/texture_mapping.pdf

slide-35
SLIDE 35

THANK YOU