1 / 11

Textures – Basic Principles

Textures – Basic Principles. Lecture 29 Fri, Nov 14, 2003. Geometry vs. Detail. There is a practical limit to how much detail we can show with geometry. For example, imagine trying to create the appearance of a brick wall through geometry. Construct brick and cement rectangles.

armen
Télécharger la présentation

Textures – Basic Principles

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. Textures – Basic Principles Lecture 29 Fri, Nov 14, 2003

  2. Geometry vs. Detail • There is a practical limit to how much detail we can show with geometry. • For example, imagine trying to create the appearance of a brick wall through geometry. • Construct brick and cement rectangles. • Color them dark red and light gray. • Would they look realistic?

  3. Textures • A much more efficient method is to • Photograph an actual brick wall. • Create a single large polygon. • Paste the photograph onto the polygon. • Not only is this more efficient, but the results are superior. • These pictures are called textures, since they give “texture” to a surface.

  4. Textures • A texture may be created externally as a bitmap file (.bmp). • It consists of a rectangular array of RGB triples (integers from 0 to 255). • Each RGB triple is called a texel.

  5. Examples • WoodGrain.bmp. • Bricks.bmp. • TextureDemo.cpp. • RgbImage.cpp.

  6. Textures • It is also possible to create textures internally as arrays of RGB triples. • This is especially convenient when the picture is geometrically simple. • The object would be a 3-dimensional array image[i][j][k]. • i = row number. • j = column number. • k = color (0 = red, 1 = green, 2 = blue).

  7. Textures • It is possible to have 1-dimensional, 2-dimensional, and 3-dimensional textures, although we will work only with 2-dimensional textures. • A texture has its own (s, t) coordinate system. • s is the horizontal coordinate, 0  s  1. • t is the vertical coordinate, 0  t  1.

  8. 1 t 0 s 0 1 Texture Parameters • Each texel has (r, s) coordinates. (.5, .5) (.75, .25)

  9. Textures • To paste a texture onto a polygon, we assign to each vertex of the polygon a pair of (s, t) coordinates. • That is, we map a portion of the texture to the polygon. • Interpolation is used to assign a texel to each pixel throughout the interior of the polygon.

  10. Mapping Textures to Faces • When a polygon is drawn, each vertex has a point in the texture mapped to it.

  11. Nate Robin’s Texture Tutorial • Tutors

More Related