Graphics Reference
In-Depth Information
Once a 3D texture or 2D texture array has been loaded using
glTexImage3D , the texture can be fetched in the shader using the
texture built-in function.
vec4 texture (sampler3D sampler , vec3 coord [ ,
float bias ])
vec4 texture (sampler2DArray sampler , vec3 coord [ ,
floatĀ  bias ])
a sampler bound to a texture unit specifying the texture to
fetch from.
sampler
a 3D texture coordinate used to fetch from the texture map.
coord
an optional parameter that provides a mipmap bias use for
the texture fetch. This allows the shader to explicitly bias the
computed LOD value used for mipmap selection.
bias
Note that the r -coordinate is a floating-point value. For 3D textures,
depending on the filtering mode set, the texture fetch might span two
slices of the volume.
Compressed Textures
Thus far, we have been dealing with textures that were loaded with
uncompressed texture image data. OpenGL ES 3.0 also supports the
loading of compressed texture image data. There are several reasons why
compressing textures is desirable. The first and obvious reason to compress
textures is to reduce the memory footprint of the textures on the device.
A second, less obvious reason to compress textures is that a memory
bandwidth savings occurs when you fetch from compressed textures
in a shader. Finally, compressed textures might allow you to reduce the
download size of your application by reducing the amount of image data
that must be stored.
In OpenGL ES 2.0, the core specification did not define any compressed
texture image formats. That is, the OpenGL ES 2.0 core simply defined a
mechanism whereby compressed texture image data could be loaded, but
no compressed formats were defined. As a result, many vendors, including
Qualcomm, ARM, Imagination Technologies, and NVIDIA, provided
hardware-specific texture compression extensions. In turn, developers of
OpenGL ES 2.0 applications had to support different texture compression
formats on different platforms and hardware.
 
 
 
Search WWH ::




Custom Search