Graphics Reference
In-Depth Information
9
Surface Textures in
the Fragment Shader
Texture mapping is a special activity within shader programs. In can be used
in vertex, geometry, tessellation, or fragment shaders, although most of the
time it seems to find its most fun use in fragment shaders. In texture map-
ping, texture coordinates from the original model are used as an index into a
1D, 2D, or 3D texture. Textures can hold any piece of information. Most of the
time, they hold information related to determining the color of a pixel during
fragment processing. However, more and more, textures are finding them-
selves being used to hold general-purpose data for a variety of shader-based
computations. However, in this chapter, we will discuss the use of textures for
image creation. While this should be familiar from your introduction to graph-
ics, you have much more control over the use of textures when you're using
fragment shaders. We will go well beyond the traditional texture mapping
and will cover other techniques, such as bump mapping and cube mapping,
179
 
 
Search WWH ::




Custom Search