• No results found

Texture State and Proxy State

In document glspec31.20090324.pdf (Page 168-170)

3.8 Texturing

3.8.12 Texture State and Proxy State

The state necessary for texture can be divided into two categories. First, there are the multiple sets of texel arrays (a single array for the rectangular texture target; one set of mipmap arrays each for the one-, two-, and three-dimensional and one- and two-dimensional array texture targets; and six sets of mipmap ar- rays for the cube map texture targets) and their number. Each array has as- sociated with it a width, height (two- and three-dimensional, rectangular, one- dimensional array, and cube map only), and depth (three-dimensional and two- dimensional array only), an integer describing the internal format of the image, integer values describing the resolutions of each of the red, green, blue, alpha, depth, and stencil components of the image, integer values describing the type (unsigned normalized, integer, floating-point, etc.) of each of the components, a boolean describing whether the image is compressed or not, and an integer size of a compressed image. Each initial texel array is null (zero width, height, and depth, internal formatRGBA, component sizes set to zero and component types set toNONE, the compressed flag set toFALSE, and a zero compressed size). The buffer texture target has associated an integer containing the name of the buffer object that provided the data store for the texture, initially zero, and an integer identifying the internal format of the texture, initiallyR8. Next, there are the four sets of texture properties, corresponding to the one-, two-, three-dimensional, and cube map texture targets. Each set consists of the selected minification and magnification filters, the wrap modes for s, t (two- and three-dimensional and cube map only), and r (three-dimensional only), the TEXTURE BORDER COLOR, two floating-point numbers describing the minimum and maximum level of detail, two integers describing the base and maximum mipmap array, a boolean flag in- dicating whether the texture is resident, and three integers describing the depth texture mode, compare mode, and compare function. In the initial state, the value assigned toTEXTURE MIN FILTERisNEAREST MIPMAP LINEAR, (except for rectangular textures, where the initial value is LINEAR), and the value for

3.8. TEXTURING 156

TEXTURE MAG FILTERisLINEAR.s, t, andr wrap modes are all set toREPEAT

(except for rectangular textures, where the initial value isCLAMP TO EDGE). The values ofTEXTURE MIN LODandTEXTURE MAX LODare -1000 and 1000 respec- tively. The values ofTEXTURE BASE LEVELandTEXTURE MAX LEVELare 0 and 1000 respectively. The value ofTEXTURE BORDER COLORis (0,0,0,0). The val- ues of TEXTURE COMPARE MODE, andTEXTURE COMPARE FUNCare NONE, and

LEQUALrespectively.

In addition to image arrays for the non-proxy texture targets described above, partially instantiated image arrays are maintained for one-, two-, and three- dimensional, rectangular, and one- and two-dimensional array textures. Addi- tionally, a single proxy image array is maintained for the cube map texture. Each proxy image array includes width, height, depth, and internal format state val- ues, as well as state for the red, green, blue, alpha, depth, and stencil component resolutions and types. Proxy arrays do not include image data nor texture parame- ters. WhenTexImage3Dis executed withtargetspecified asPROXY TEXTURE 3D, the three-dimensional proxy state values of the specified level-of-detail are recom- puted and updated. If the image array would not be supported byTexImage3D called withtargetset toTEXTURE 3D, no error is generated, but the proxy width, height, depth, and component resolutions are set to zero, and the component types are set toNONE. If the image array would be supported by such a call toTexIm- age3D, the proxy state values are set exactly as though the actual image array were being specified. No pixel data are transferred or processed in either case.

Proxy arrays for one- and two-dimensional textures and one- and two- dimensional array textures are operated on in the same way whenTexImage1D is executed with target specified as PROXY TEXTURE 1D, TexImage2D is exe- cuted withtarget specified asPROXY TEXTURE 2D,PROXY TEXTURE 1D ARRAY, orPROXY TEXTURE RECTANGLE, or TexImage3D is executed withtarget speci- fied asPROXY TEXTURE 2D ARRAY.

The cube map proxy arrays are operated on in the same manner whenTexIm- age2Dis executed with thetarget field specified asPROXY TEXTURE CUBE MAP, with the addition that determining that a given cube map texture is supported with

PROXY TEXTURE CUBE MAPindicates that all six of the cube map 2D images are supported. Likewise, if the specifiedPROXY TEXTURE CUBE MAPis not supported, none of the six cube map 2D images are supported.

There is no image or non-level-related state associated with proxy textures. Therefore they may not be used as textures, and calling BindTexture, GetTex- Image,GetTexParameteriv, orGetTexParameterfvwith a proxy texturetarget

3.8. TEXTURING 157

In document glspec31.20090324.pdf (Page 168-170)