Introduction

Texture is one of the basic attributes of objects besides color and shape. It is the structure of a material surface.

Texture types

Classification according to description of surface

In 1986 Heckbert [3] proposed classification of the textures according to how the given characteristics of a surface are. They are classified as follows:

  • Most frequently, texture is defined using a color of surface, which is identified by a value of diffusion image.
  • Reflection of light causes the reflection of surrounding objects (glossiness) on the surface of texture. Therefore, we call this also environment mapping.
  • Change in the normal vector changes optically the shape of a surface without any change in object geometry. For example this can be a bump mapping.
  • Roughness, similarly as in the case of a change in the normal vector, this modifies optically the shape of a surface.
  • Transparency does not have to be constant over the whole of a surface, but this attribute can change with a change of place. In this there is a modification of the geometric features of an object.

Classification according to dimensions  

    Another classification is according to the dimensions of texture: 2-dimensional and 3-dimensional textures.  

    2-dimensional textures are mapped directly on to the surface of objects, while a 3-diemnsional texture is defined by a scalar field in area. They are called solid textures.

    3D textures can be classified according to what the attribute of a given surface represents. The simplest attribute is the color of a point. Here, it is enough to calculate the value of texture at a given point in an area. Another attribute is the transparency of a given point. This type of 3D textures is called hypertextures. Their basic characteristic is that they do not determine any surface. They are used mainly for modeling such types of object as hair, fog, fire and similar.

Classification according to representation 

The last type of classification is according to representation of textures. We can split these into tabular type and procedural type. A 2D or 3D texture can be stored in a table (2 or 3 dimensional), where most frequently it is stored as a picture in a graphics format, or by a procedure in the case of procedural texturing.

Texture mapping

The process of coating texture on to a surface is called texture mapping. The ways of texture mapping depend on the manner in which the texture is set, because there is a great difference in mapping a texture in 2D or in 3D areas, or according to the shape of the object on to which we are mapping a texture.

[1] According to [1], from the mathematical point of view, we can define a general texture as a projection of a plane, flat area into a module area, which can be an area of colors, or levels of gray:

    
    t : Dt -- > M, kde Dt ∈R^2  a M ∈ R^3. 

    If we have a defined shape of an object, then using general mapping we can display for each point of the surface a dot from the area of texture.  
   
  m : Dm -- > Dt, where Dm is area on the object.

Texturing is the process of assigning coordinates of texture (of a bitmap) to image coordinates as seen in the following applet.

$$$APPLET
Applet : Texture

$$$APPLET

Applet Texturing into cylinder. Author: Duriga Juraj

Inverse mapping of a cylinder surface

Let's take the example of texture mapping on a cylinder. A cylinder is represented by the following rotation surface:

         x = r * cos u,    y = r * sin u,    z = v,

where v ∈ <0, and u ∈<0,2π>. where v ∈ <0, hight> and u ∈ <0, 2π>.


alt="Your browser understandsthe  APPLET tag but isn't running the applet, for some reason." Your browser is completely ignoring the  APPLET tag! 

Applet Inverse mapping on the cylinder



Applet Mapping texture

Then, for any point (x, y, z) on the cylinder, we have inverse mapping :

          arccos x / r  pre y=<0 
u =
         arccos x / r   + π    for y>0

v = z.

Texture samples

Picture Procedural texture no. 1


Picture Procedural texture no. 2


Picture Procedural texture no. 3

Texture mapping a sphere.

Uživateľská špecifikácia: Applet bude demonštratívne zobrazovať základné princípy mapovania textúry na guľu. Prvou vecou ktoru bude applet umožnovať je zobrazenie guľe pozostávajúcu z nastaviteľného množstva polygónov ktora sa bude dať dragovaním kurzora myši otáčať okolo X a Y osí. Guľu budeme môcť zobraziť buď v sieťovej štruktúre alebo vykresliť celé plné polygóny. Zapnutím “osvetlenia” sa budú polygóny bližšie k svetlu zobrazovať svetlejšie ako polygóny vzdialenejšie. Ďalej budeme mať možnosť skryť odvrátenú stranu guľe, teda polygóny ktoré by pozorovateľ nemal vidieť poskytovať dve názorné mapovania surádnic : z textúry na guľu a z guľy na textúru. Kliknutím na obdĺžnik sa nám surádnice u,v zobrazia na súradnnice x,y,z na guli, zároveň sa nám guľa natočí tak, aby sme daný bod videli. Takisto kliknutím na ľubovolný bod na guľi sa nám bod x,y,z zobrazí na bod u,v. Applet nam týmito zobrazeniamu demonštratívne potvrdí že mapovanie textúry na guľu je bijektívne zobrazenie. Ako bonusová funkcia tu bude samotné namapovanie textúry zeme na guľu. Toto mapovanie textúry bude softwarovo rátane pre každy polygón ktorý vidíme a pre každý pixel, takže vykreslenie jedného obrázku môže trvať pomerne dlho, preto nedoporučujem moc rotovať guľu v tomto móde.

$$$APPLET

Applet Texture mapping a sphere. Author Madaras Martin

Source code for NetBeans