15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_paletted_texture 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_paletted_texture 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciVersion 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Last Modified Date: March 24, 2004 165bd8deadSopenharmony_ci Revision: 1.4 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciNumber 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci 78 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciSupport 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Intel 810/815. 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci Mesa. 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci Microsoft software OpenGL implementation. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci Selected NVIDIA GPUs: NV1x (GeForce 256, GeForce2, GeForce4 MX, 315bd8deadSopenharmony_ci GeForce4 Go, Quadro, Quadro2), NV2x (GeForce3, GeForce4 Ti, 325bd8deadSopenharmony_ci Quadro DCC, Quadro4 XGL), and NV3x (GeForce FX 5xxxx, Quadro FX 335bd8deadSopenharmony_ci 1000/2000/3000). NV3 (Riva 128) and NV4 (TNT, TNT2) GPUs and NV4x 345bd8deadSopenharmony_ci GPUs do NOT support this functionality (no hardware support). 355bd8deadSopenharmony_ci Future NVIDIA GPU designs will no longer support paletted textures. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci S3 ProSavage, Savage 2000. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci 3Dfx Voodoo3, Voodoo5. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci 3Dlabs GLINT. 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ciDependencies 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci GL_EXT_paletted_texture shares routines and enumerants with 465bd8deadSopenharmony_ci GL_SGI_color_table with the minor modification that EXT replaces SGI. 475bd8deadSopenharmony_ci In all other ways these calls should function in the same manner and the 485bd8deadSopenharmony_ci enumerant values should be identical. The portions of 495bd8deadSopenharmony_ci GL_SGI_color_table that are used are: 505bd8deadSopenharmony_ci ColorTableSGI, GetColorTableSGI, GetColorTableParameterivSGI, 515bd8deadSopenharmony_ci GetColorTableParameterfvSGI. 525bd8deadSopenharmony_ci COLOR_TABLE_FORMAT_SGI, COLOR_TABLE_WIDTH_SGI, 535bd8deadSopenharmony_ci COLOR_TABLE_RED_SIZE_SGI, COLOR_TABLE_GREEN_SIZE_SGI, 545bd8deadSopenharmony_ci COLOR_TABLE_BLUE_SIZE_SGI, COLOR_TABLE_ALPHA_SIZE_SGI, 555bd8deadSopenharmony_ci COLOR_TABLE_LUMINANCE_SIZE_SGI, COLOR_TABLE_INTENSITY_SIZE_SGI. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci Portions of GL_SGI_color_table which are not used in 585bd8deadSopenharmony_ci GL_EXT_paletted_texture are: 595bd8deadSopenharmony_ci CopyColorTableSGI, ColorTableParameterivSGI, 605bd8deadSopenharmony_ci ColorTableParameterfvSGI. 615bd8deadSopenharmony_ci COLOR_TABLE_SGI, POST_CONVOLUTION_COLOR_TABLE_SGI, 625bd8deadSopenharmony_ci POST_COLOR_MATRIX_COLOR_TABLE_SGI, PROXY_COLOR_TABLE_SGI, 635bd8deadSopenharmony_ci PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI, 645bd8deadSopenharmony_ci PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI, COLOR_TABLE_SCALE_SGI, 655bd8deadSopenharmony_ci COLOR_TABLE_BIAS_SGI. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci EXT_paletted_texture can be used in conjunction with EXT_texture3D. 685bd8deadSopenharmony_ci EXT_paletted_texture modifies TexImage3DEXT to accept paletted image 695bd8deadSopenharmony_ci data and allows TEXTURE_3D_EXT and PROXY_TEXTURE_3D_EXT to be used a 705bd8deadSopenharmony_ci targets in the color table routines. If EXT_texture3D is unsupported 715bd8deadSopenharmony_ci then references to 3D texture support in this spec are invalid and 725bd8deadSopenharmony_ci should be ignored. 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci EXT_paletted_texture can be used in conjunction with 755bd8deadSopenharmony_ci ARB_texture_cube_map. EXT_paletted_texture modifies TexImage2D 765bd8deadSopenharmony_ci to accept paletted image data and allows TEXTURE_CUBE_MAP_ARB, and 775bd8deadSopenharmony_ci PROXY_TEXTURE_CUBE_MAP_ARB to be used a targets in the color table 785bd8deadSopenharmony_ci routines. If ARB_texture_cube_map is unsupported then references 795bd8deadSopenharmony_ci to cube map texture support in this spec are invalid and should be 805bd8deadSopenharmony_ci ignored. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ciOverview 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci EXT_paletted_texture defines new texture formats and new calls to 855bd8deadSopenharmony_ci support the use of paletted textures in OpenGL. A paletted texture is 865bd8deadSopenharmony_ci defined by giving both a palette of colors and a set of image data which 875bd8deadSopenharmony_ci is composed of indices into the palette. The paletted texture cannot 885bd8deadSopenharmony_ci function properly without both pieces of information so it increases the 895bd8deadSopenharmony_ci work required to define a texture. This is offset by the fact that the 905bd8deadSopenharmony_ci overall amount of texture data can be reduced dramatically by factoring 915bd8deadSopenharmony_ci redundant information out of the logical view of the texture and placing 925bd8deadSopenharmony_ci it in the palette. 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci Paletted textures provide several advantages over full-color textures: 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci * As mentioned above, the amount of data required to define a 975bd8deadSopenharmony_ci texture can be greatly reduced over what would be needed for full-color 985bd8deadSopenharmony_ci specification. For example, consider a source texture that has only 256 995bd8deadSopenharmony_ci distinct colors in a 256 by 256 pixel grid. Full-color representation 1005bd8deadSopenharmony_ci requires three bytes per pixel, taking 192K of texture data. By putting 1015bd8deadSopenharmony_ci the distinct colors in a palette only eight bits are required per pixel, 1025bd8deadSopenharmony_ci reducing the 192K to 64K plus 768 bytes for the palette. Now add an 1035bd8deadSopenharmony_ci alpha channel to the texture. The full-color representation increases 1045bd8deadSopenharmony_ci by 64K while the paletted version would only increase by 256 bytes. 1055bd8deadSopenharmony_ci This reduction in space required is particularly important for hardware 1065bd8deadSopenharmony_ci accelerators where texture space is limited. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci * Paletted textures allow easy reuse of texture data for images 1095bd8deadSopenharmony_ci which require many similar but slightly different colored objects. 1105bd8deadSopenharmony_ci Consider a driving simulation with heavy traffic on the road. Many of 1115bd8deadSopenharmony_ci the cars will be similar but with different color schemes. If 1125bd8deadSopenharmony_ci full-color textures are used a separate texture would be needed for each 1135bd8deadSopenharmony_ci color scheme, while paletted textures allow the same basic index data to 1145bd8deadSopenharmony_ci be reused for each car, with a different palette to change the final 1155bd8deadSopenharmony_ci colors. 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci * Paletted textures also allow use of all the palette tricks 1185bd8deadSopenharmony_ci developed for paletted displays. Simple animation can be done, along 1195bd8deadSopenharmony_ci with strobing, glowing and other palette-cycling effects. All of these 1205bd8deadSopenharmony_ci techniques can enhance the visual richness of a scene with very little 1215bd8deadSopenharmony_ci data. 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ciIP Status 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci None. 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ciNew Procedures and Functions 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci void ColorTableEXT( 1305bd8deadSopenharmony_ci enum target, 1315bd8deadSopenharmony_ci enum internalFormat, 1325bd8deadSopenharmony_ci sizei width, 1335bd8deadSopenharmony_ci enum format, 1345bd8deadSopenharmony_ci enum type, 1355bd8deadSopenharmony_ci const void *data); 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci void ColorSubTableEXT( 1385bd8deadSopenharmony_ci enum target, 1395bd8deadSopenharmony_ci sizei start, 1405bd8deadSopenharmony_ci sizei count, 1415bd8deadSopenharmony_ci enum format, 1425bd8deadSopenharmony_ci enum type, 1435bd8deadSopenharmony_ci const void *data); 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci void GetColorTableEXT( 1465bd8deadSopenharmony_ci enum target, 1475bd8deadSopenharmony_ci enum format, 1485bd8deadSopenharmony_ci enum type, 1495bd8deadSopenharmony_ci void *data); 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci void GetColorTableParameterivEXT( 1525bd8deadSopenharmony_ci enum target, 1535bd8deadSopenharmony_ci enum pname, 1545bd8deadSopenharmony_ci int *params); 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci void GetColorTableParameterfvEXT( 1575bd8deadSopenharmony_ci enum target, 1585bd8deadSopenharmony_ci enum pname, 1595bd8deadSopenharmony_ci float *params); 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ciNew Tokens 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci Accepted by the internalformat parameter of TexImage1D, TexImage2D and 1645bd8deadSopenharmony_ci TexImage3DEXT: 1655bd8deadSopenharmony_ci COLOR_INDEX1_EXT 0x80E2 1665bd8deadSopenharmony_ci COLOR_INDEX2_EXT 0x80E3 1675bd8deadSopenharmony_ci COLOR_INDEX4_EXT 0x80E4 1685bd8deadSopenharmony_ci COLOR_INDEX8_EXT 0x80E5 1695bd8deadSopenharmony_ci COLOR_INDEX12_EXT 0x80E6 1705bd8deadSopenharmony_ci COLOR_INDEX16_EXT 0x80E7 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci Accepted by the pname parameter of GetColorTableParameterivEXT and 1735bd8deadSopenharmony_ci GetColorTableParameterfvEXT: 1745bd8deadSopenharmony_ci COLOR_TABLE_FORMAT_EXT 0x80D8 1755bd8deadSopenharmony_ci COLOR_TABLE_WIDTH_EXT 0x80D9 1765bd8deadSopenharmony_ci COLOR_TABLE_RED_SIZE_EXT 0x80DA 1775bd8deadSopenharmony_ci COLOR_TABLE_GREEN_SIZE_EXT 0x80DB 1785bd8deadSopenharmony_ci COLOR_TABLE_BLUE_SIZE_EXT 0x80DC 1795bd8deadSopenharmony_ci COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD 1805bd8deadSopenharmony_ci COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE 1815bd8deadSopenharmony_ci COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci Accepted by the value parameter of GetTexLevelParameter{if}v: 1845bd8deadSopenharmony_ci TEXTURE_INDEX_SIZE_EXT 0x80ED 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci Accepted by the target parameter of ColorTableEXT, 1875bd8deadSopenharmony_ci GetColorTableParameterivEXT, and GetColorTableParameterfvEXT: 1885bd8deadSopenharmony_ci TEXTURE_1D 0x0DE0 1895bd8deadSopenharmony_ci TEXTURE_2D 0x0DE1 1905bd8deadSopenharmony_ci TEXTURE_3D_EXT 0x806F 1915bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_ARB 0x8513 1925bd8deadSopenharmony_ci PROXY_TEXTURE_1D 0x8063 1935bd8deadSopenharmony_ci PROXY_TEXTURE_2D 0x8064 1945bd8deadSopenharmony_ci PROXY_TEXTURE_3D_EXT 0x8070 1955bd8deadSopenharmony_ci PROXY_TEXTURE_CUBE_MAP_ARB 0x851B 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci Accepted by the target parameter of ColorSubTableEXT and 1985bd8deadSopenharmony_ci GetColorTableEXT: 1995bd8deadSopenharmony_ci TEXTURE_1D 0x0DE0 2005bd8deadSopenharmony_ci TEXTURE_2D 0x0DE1 2015bd8deadSopenharmony_ci TEXTURE_3D_EXT 0x806F 2025bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_ARB 0x8513 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation) 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci None 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ciAdditions to Chapter 3 of the GL Specification (Rasterization) 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci Section 3.6.4, 'Pixel Transfer Operations,' subsection 'Color Index 2115bd8deadSopenharmony_ci Lookup,' 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci Point two is modified from 'The groups will be loaded as an 2145bd8deadSopenharmony_ci image into texture memory' to 'The groups will be loaded as an image 2155bd8deadSopenharmony_ci into texture memory and the internalformat parameter is not one of the 2165bd8deadSopenharmony_ci color index formats from table 3.8.' 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci Section 3.8, 'Texturing,' subsection 'Texture Image Specification' is 2195bd8deadSopenharmony_ci modified as follows: 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci The portion of the first paragraph discussing interpretation of format, 2225bd8deadSopenharmony_ci type and data is split from the portion discussing target, width and 2235bd8deadSopenharmony_ci height. The target, width and height section now ends with the sentence 2245bd8deadSopenharmony_ci 'Arguments width and height specify the image's width and height.' 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci The format, type and data section is moved under a subheader 'Direct 2275bd8deadSopenharmony_ci Color Texture Formats' and begins with 'If internalformat is not one of 2285bd8deadSopenharmony_ci the color index formats from table 3.8,' and continues with the existing 2295bd8deadSopenharmony_ci text through the internalformat discussion. 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ci After that section, a new section 'Paletted Texture Formats' has the 2325bd8deadSopenharmony_ci text: 2335bd8deadSopenharmony_ci If format is given as COLOR_INDEX then the image data is 2345bd8deadSopenharmony_ci composed of integer values representing indices into a table of colors 2355bd8deadSopenharmony_ci rather than colors themselves. If internalformat is given as one of the 2365bd8deadSopenharmony_ci color index formats from table 3.8 then the texture will be stored 2375bd8deadSopenharmony_ci internally as indices rather than undergoing index-to-RGBA mapping as 2385bd8deadSopenharmony_ci would previously have occurred. In this case the only valid values for 2395bd8deadSopenharmony_ci type are BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT, INT and 2405bd8deadSopenharmony_ci UNSIGNED_INT. 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci The image data is unpacked from memory exactly as for a 2435bd8deadSopenharmony_ci DrawPixels command with format of COLOR_INDEX for a context in color 2445bd8deadSopenharmony_ci index mode. The data is then stored in an internal format derived from 2455bd8deadSopenharmony_ci internalformat. In this case the only legal values of internalformat 2465bd8deadSopenharmony_ci are COLOR_INDEX1_EXT, COLOR_INDEX2_EXT, COLOR_INDEX4_EXT, 2475bd8deadSopenharmony_ci COLOR_INDEX8_EXT, COLOR_INDEX12_EXT and COLOR_INDEX16_EXT and the 2485bd8deadSopenharmony_ci internal component resolution is picked according to the index 2495bd8deadSopenharmony_ci resolution specified by internalformat. Any excess precision in the 2505bd8deadSopenharmony_ci data is silently truncated to fit in the internal component precision. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci An application can determine whether a particular 2535bd8deadSopenharmony_ci implementation supports a particular paletted format (or any paletted 2545bd8deadSopenharmony_ci formats at all) by attempting to use the paletted format with a proxy 2555bd8deadSopenharmony_ci target. TEXTURE_INDEX_SIZE_EXT will be zero if the implementation 2565bd8deadSopenharmony_ci cannot support the texture as given. 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ci An application can determine an implementation's desired 2595bd8deadSopenharmony_ci format for a particular paletted texture by making a TexImage call with 2605bd8deadSopenharmony_ci COLOR_INDEX as the internalformat, in which case target must be a proxy 2615bd8deadSopenharmony_ci target. After the call the application can query 2625bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT to determine what internal format the 2635bd8deadSopenharmony_ci implementation suggests for the texture image parameters. 2645bd8deadSopenharmony_ci TEXTURE_INDEX_SIZE_EXT can be queried after such a call to determine the 2655bd8deadSopenharmony_ci suggested index resolution numerically. The index resolution suggested 2665bd8deadSopenharmony_ci by the implementation does not have to be as large as the input data 2675bd8deadSopenharmony_ci precision. The resolution may also be zero if the implementation is 2685bd8deadSopenharmony_ci unable to support any paletted format for the given texture image. 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci Table 3.8 should be augmented with a column titled 'Index bits.' All 2715bd8deadSopenharmony_ci existing formats have zero index bits. The following formats are added 2725bd8deadSopenharmony_ci with zeroes in all existing columns: 2735bd8deadSopenharmony_ci Name Index bits 2745bd8deadSopenharmony_ci COLOR_INDEX1_EXT 1 2755bd8deadSopenharmony_ci COLOR_INDEX2_EXT 2 2765bd8deadSopenharmony_ci COLOR_INDEX4_EXT 4 2775bd8deadSopenharmony_ci COLOR_INDEX8_EXT 8 2785bd8deadSopenharmony_ci COLOR_INDEX12_EXT 12 2795bd8deadSopenharmony_ci COLOR_INDEX16_EXT 16 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ci At the end of the discussion of level the following text should be 2825bd8deadSopenharmony_ci added: 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci All mipmapping levels share the same palette. If levels 2855bd8deadSopenharmony_ci are created with different precision indices then their internal formats 2865bd8deadSopenharmony_ci will not match and the texture will be inconsistent, as discussed above. 2875bd8deadSopenharmony_ci 2885bd8deadSopenharmony_ci In the discussion of internalformat for CopyTexImage{12}D, at end of the 2895bd8deadSopenharmony_ci sentence specifying that 1, 2, 3 and 4 are illegal there should also be 2905bd8deadSopenharmony_ci a mention that paletted internalformat values are illegal. 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci At the end of the width, height, format, type and data section under 2935bd8deadSopenharmony_ci TexSubImage there should be an additional sentence: 2945bd8deadSopenharmony_ci 2955bd8deadSopenharmony_ci If the target texture has a color index internal format 2965bd8deadSopenharmony_ci then format may only be COLOR_INDEX. 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci At the end of the first paragraph describing TexSubImage and 2995bd8deadSopenharmony_ci CopyTexSubImage the following sentence should be added: 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ci If the target of a CopyTexSubImage is a paletted texture 3025bd8deadSopenharmony_ci image then INVALID_OPERATION is returned. 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci After the Alternate Image Specification Commands section, a new 'Palette 3055bd8deadSopenharmony_ci Specification Commands' section should be added. 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci Paletted textures require palette information to 3085bd8deadSopenharmony_ci translate indices into full colors. The command 3095bd8deadSopenharmony_ci void ColorTableEXT(enum target, enum internalformat, sizei width, 3105bd8deadSopenharmony_ci enum format, enum type, const void *data); 3115bd8deadSopenharmony_ci is used to specify the format and size of the palette for paletted 3125bd8deadSopenharmony_ci textures. target specifies which texture is to have its palette 3135bd8deadSopenharmony_ci changed and may be one of TEXTURE_1D, TEXTURE_2D, PROXY_TEXTURE_1D, 3145bd8deadSopenharmony_ci PROXY_TEXTURE_2D, TEXTURE_3D_EXT, PROXY_TEXTURE_3D_EXT, 3155bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_ARB, or PROXY_TEXTURE_CUBE_MAP_ARB. internalformat 3165bd8deadSopenharmony_ci specifies the desired format and resolution of the palette when 3175bd8deadSopenharmony_ci in its internal form. internalformat can be any of the non-index 3185bd8deadSopenharmony_ci values legal for TexImage internalformat although implementations 3195bd8deadSopenharmony_ci are not required to support palettes of all possible formats. 3205bd8deadSopenharmony_ci width controls the size of the palette and must be a power of two 3215bd8deadSopenharmony_ci greater than or equal to one. format and type specify the number 3225bd8deadSopenharmony_ci of components and type of the data given by data. format can be 3235bd8deadSopenharmony_ci any of the formats legal for DrawPixels although implementations 3245bd8deadSopenharmony_ci are not required to support all possible formats. type can be 3255bd8deadSopenharmony_ci any of the types legal for DrawPixels except GL_BITMAP. 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci Data is taken from memory and converted just as if each 3285bd8deadSopenharmony_ci palette entry were a single pixel of a 1D texture. Pixel unpacking and 3295bd8deadSopenharmony_ci transfer modes apply just as with texture data. After unpacking and 3305bd8deadSopenharmony_ci conversion the data is translated into a internal format that matches 3315bd8deadSopenharmony_ci the given format as closely as possible. An implementation does not, 3325bd8deadSopenharmony_ci however, have a responsibility to support more than one precision for 3335bd8deadSopenharmony_ci the base formats. 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci If the palette's width is greater than than the range of 3365bd8deadSopenharmony_ci the color indices in the texture data then some of the palettes entries 3375bd8deadSopenharmony_ci will be unused. If the palette's width is less than the range of the 3385bd8deadSopenharmony_ci color indices in the texture data then the most-significant bits of the 3395bd8deadSopenharmony_ci texture data are ignored and only the appropriate number of bits of the 3405bd8deadSopenharmony_ci index are used when accessing the palette. 3415bd8deadSopenharmony_ci 3425bd8deadSopenharmony_ci Specifying a proxy target causes the proxy texture's 3435bd8deadSopenharmony_ci palette to be resized and its parameters set but no data is transferred 3445bd8deadSopenharmony_ci or accessed. If an implementation cannot handle the palette data given 3455bd8deadSopenharmony_ci in the call then the color table width and component resolutions are set 3465bd8deadSopenharmony_ci to zero. 3475bd8deadSopenharmony_ci 3485bd8deadSopenharmony_ci Portions of the current palette can be replaced with 3495bd8deadSopenharmony_ci void ColorSubTableEXT(enum target, sizei start, sizei count, 3505bd8deadSopenharmony_ci enum format, enum type, const void *data); 3515bd8deadSopenharmony_ci target can be any of the non-proxy values legal for 3525bd8deadSopenharmony_ci ColorTableEXT. start and count control which entries of the palette are 3535bd8deadSopenharmony_ci changed out of the range allowed by the internal format used for the 3545bd8deadSopenharmony_ci palette indices. count is silently clamped so that all modified entries 3555bd8deadSopenharmony_ci all within the legal range. format and type can be any of the values 3565bd8deadSopenharmony_ci legal for ColorTableEXT. The data is treated as a 1D texture just as in 3575bd8deadSopenharmony_ci ColorTableEXT. 3585bd8deadSopenharmony_ci 3595bd8deadSopenharmony_ci In the 'Texture State and Proxy State' section the sentence fragment 3605bd8deadSopenharmony_ci beginning 'six integer values describing the resolutions...' should be 3615bd8deadSopenharmony_ci changed to refer to seven integer values, with the seventh being the 3625bd8deadSopenharmony_ci index resolution. 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci Palette data should be added in as a third category of texture state. 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci After the discussion of properties, the following should be added: 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci Next there is the texture palette. All textures have a 3695bd8deadSopenharmony_ci palette, even if their internal format is not color index. A texture's 3705bd8deadSopenharmony_ci palette is initially one RGBA element with all four components set to 3715bd8deadSopenharmony_ci 1.0. 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci The sentence mentioning that proxies do not have image data or 3745bd8deadSopenharmony_ci properties should be extended with 'or palettes.' 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ci The sentence beginning 'If the texture array is too large' describing 3775bd8deadSopenharmony_ci the effects of proxy failure should change to read: 3785bd8deadSopenharmony_ci 3795bd8deadSopenharmony_ci If the implementation is unable to handle the texture 3805bd8deadSopenharmony_ci image data the proxy width, height, border width and component 3815bd8deadSopenharmony_ci resolutions are set to zero. This situation can occur when the texture 3825bd8deadSopenharmony_ci array is too large or an unsupported paletted format was requested. 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ciAdditions to Chapter 4 of the GL Specification (Per-Fragment Operations 3855bd8deadSopenharmony_ciand the Framebuffer) 3865bd8deadSopenharmony_ci 3875bd8deadSopenharmony_ci None 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ciAdditions to Chapter 5 of the GL Specification (Special Functions) 3905bd8deadSopenharmony_ci 3915bd8deadSopenharmony_ci Section 5.4, 'Display Lists' is modified as follows: 3925bd8deadSopenharmony_ci 3935bd8deadSopenharmony_ci Include PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_3D, 3945bd8deadSopenharmony_ci and PROXY_TEXTURE_CUBE_MAP_ARB in the list of tokens for which 3955bd8deadSopenharmony_ci ColorTableEXT is executed immediately. 3965bd8deadSopenharmony_ci 3975bd8deadSopenharmony_ciAdditions to Chapter 6 of the GL Specification (State and State 3985bd8deadSopenharmony_ciRequests) 3995bd8deadSopenharmony_ci 4005bd8deadSopenharmony_ci In the section on GetTexImage, the sentence saying 'The components are 4015bd8deadSopenharmony_ci assigned among R, G, B and A according to' should be changed to be 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci If the internal format of the texture is not a color 4045bd8deadSopenharmony_ci index format then the components are assigned among R, G, B, and A 4055bd8deadSopenharmony_ci according to Table 6.1. Specifying COLOR_INDEX for format in this case 4065bd8deadSopenharmony_ci will generate the error INVALID_ENUM. If the internal format of the 4075bd8deadSopenharmony_ci texture is color index then the components are handled in one of two 4085bd8deadSopenharmony_ci ways depending on the value of format. If format is not COLOR_INDEX, 4095bd8deadSopenharmony_ci the texture's indices are passed through the texture's palette and the 4105bd8deadSopenharmony_ci resulting components are assigned among R, G, B, and A according to 4115bd8deadSopenharmony_ci Table 6.1. If format is COLOR_INDEX then the data is treated as single 4125bd8deadSopenharmony_ci components and the palette indices are returned. Components are taken 4135bd8deadSopenharmony_ci starting... 4145bd8deadSopenharmony_ci 4155bd8deadSopenharmony_ci Following the GetTexImage section there should be a new section: 4165bd8deadSopenharmony_ci 4175bd8deadSopenharmony_ci GetColorTableEXT is used to get the current texture 4185bd8deadSopenharmony_ci palette. 4195bd8deadSopenharmony_ci void GetColorTableEXT(enum target, enum format, enum type, void *data); 4205bd8deadSopenharmony_ci 4215bd8deadSopenharmony_ci GetColorTableEXT retrieves the texture palette of the 4225bd8deadSopenharmony_ci texture given by target. target can be any of the non-proxy targets 4235bd8deadSopenharmony_ci valid for ColorTableEXT. format and type are interpreted just as for 4245bd8deadSopenharmony_ci ColorTableEXT. All textures have a palette by default so 4255bd8deadSopenharmony_ci GetColorTableEXT will always be able to return data even if the internal 4265bd8deadSopenharmony_ci format of the texture is not a color index format. 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ci Palette parameters can be retrieved using 4295bd8deadSopenharmony_ci void GetColorTableParameterivEXT(enum target, enum pname, int *params); 4305bd8deadSopenharmony_ci void GetColorTableParameterfvEXT(enum target, enum pname, float *params); 4315bd8deadSopenharmony_ci target specifies the texture being queried and pname 4325bd8deadSopenharmony_ci controls which parameter value is returned. Data is returned in the 4335bd8deadSopenharmony_ci memory pointed to by params. 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci Querying COLOR_TABLE_FORMAT_EXT returns the internal 4365bd8deadSopenharmony_ci format requested by the most recent ColorTableEXT call or the default. 4375bd8deadSopenharmony_ci COLOR_TABLE_WIDTH_EXT returns the width of the current palette. 4385bd8deadSopenharmony_ci COLOR_TABLE_RED_SIZE_EXT, COLOR_TABLE_GREEN_SIZE_EXT, 4395bd8deadSopenharmony_ci COLOR_TABLE_BLUE_SIZE_EXT and COLOR_TABLE_ALPHA_SIZE_EXT return the 4405bd8deadSopenharmony_ci actual size of the components used to store the palette data internally, 4415bd8deadSopenharmony_ci not the size requested when the palette was defined. 4425bd8deadSopenharmony_ci 4435bd8deadSopenharmony_ci Table 6.11, "Texture Objects" should have a line appended for 4445bd8deadSopenharmony_ci TEXTURE_INDEX_SIZE_EXT: 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci TEXTURE_INDEX_SIZE_EXT n x Z+ GetTexLevelParameter 0 xD texture image i's index resolution 3.8 - 4475bd8deadSopenharmony_ci 4485bd8deadSopenharmony_ciNew State 4495bd8deadSopenharmony_ci 4505bd8deadSopenharmony_ci In table 6.16, Texture Objects, p. 224, add the following: 4515bd8deadSopenharmony_ci 4525bd8deadSopenharmony_ciGet Value Type Get Command Initial Value Description Sec. Attribute 4535bd8deadSopenharmony_ci---------------------- -------- --------------------------- ------------- ---------------- ----- --------- 4545bd8deadSopenharmony_ciTEXTURE_1D I GetColorTableEXT empty 1D palette 3.8 - 4555bd8deadSopenharmony_ciTEXTURE_2D I GetColorTableEXT empty 2D palette 3.8 - 4565bd8deadSopenharmony_ciTEXTURE_3D I GetColorTableEXT empty 3D palette 3.8 - 4575bd8deadSopenharmony_ciTEXTURE_CUBE_MAP I GetColorTableEXT empty cube map palette 3.8 - 4585bd8deadSopenharmony_ciCOLOR_TABLE_FORMAT_EXT 2x4xZn GetColorTableParameterivEXT RGBA paletted texture 3.8 - 4595bd8deadSopenharmony_ci formats 4605bd8deadSopenharmony_ciCOLOR_TABLE_WIDTH_EXT 2x4xZ+ GetColorTableParameteriv 0 paletted texture 3.8 - 4615bd8deadSopenharmony_ci width 4625bd8deadSopenharmony_ciCOLOR_TABLE_x_SIZE_EXT 6x2x4xZ+ GetColorTableParameteriv 0 paletted texture 3.8 - 4635bd8deadSopenharmony_ci component sizes 4645bd8deadSopenharmony_ciTEXTURE_INDEX_SIZE_EXT nxZ+ GetTexLevelParameter 0 texture image's 3.8 - 4655bd8deadSopenharmony_ci index resolution 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ciNew Implementation Dependent State 4685bd8deadSopenharmony_ci 4695bd8deadSopenharmony_ci None 4705bd8deadSopenharmony_ci 4715bd8deadSopenharmony_ciRevision History 4725bd8deadSopenharmony_ci 4735bd8deadSopenharmony_ciOriginal draft, revision 0.5, December 20, 1995 (drewb) Created 4745bd8deadSopenharmony_ci 4755bd8deadSopenharmony_ciMinor revisions and clarifications, revision 0.6, January 2, 1996 (drewb) 4765bd8deadSopenharmony_ci Replaced all request-for-comment blocks with final text 4775bd8deadSopenharmony_ci based on implementation. 4785bd8deadSopenharmony_ci 4795bd8deadSopenharmony_ciMinor revisions and clarifications, revision 0.7, Feburary 5, 1996 (drewb) 4805bd8deadSopenharmony_ci Specified the state of the palette color information 4815bd8deadSopenharmony_ci when existing data is replaced by new data. 4825bd8deadSopenharmony_ci 4835bd8deadSopenharmony_ci Clarified behavior of TexPalette on inconsistent textures. 4845bd8deadSopenharmony_ci 4855bd8deadSopenharmony_ciMajor changes due to ARB review, revision 0.8, March 1, 1996 (drewb) 4865bd8deadSopenharmony_ci Switched from using TexPaletteEXT and GetTexPaletteEXT 4875bd8deadSopenharmony_ci to using SGI's ColorTableEXT routines. Added ColorSubTableEXT so 4885bd8deadSopenharmony_ci equivalent functionality is available. 4895bd8deadSopenharmony_ci 4905bd8deadSopenharmony_ci Allowed proxies in all targets. 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci Changed PALETTE?_EXT values to COLOR_INDEX?_EXT. Added 4935bd8deadSopenharmony_ci support for one and two bit palettes. Removed PALETTE_INDEX_EXT in 4945bd8deadSopenharmony_ci favor of COLOR_INDEX. 4955bd8deadSopenharmony_ci 4965bd8deadSopenharmony_ci Decoupled palette size from texture data type. Palette 4975bd8deadSopenharmony_ci size is controlled only by ColorTableEXT. 4985bd8deadSopenharmony_ci 4995bd8deadSopenharmony_ciChanges due to ARB review, revision 1.0, May 23, 1997 (drewb) 5005bd8deadSopenharmony_ci Mentioned texture3D. 5015bd8deadSopenharmony_ci 5025bd8deadSopenharmony_ci Defined TEXTURE_INDEX_SIZE_EXT. 5035bd8deadSopenharmony_ci 5045bd8deadSopenharmony_ci Allowed implementations to return an index size of zero to indicate 5055bd8deadSopenharmony_ci no support for a particular format. 5065bd8deadSopenharmony_ci 5075bd8deadSopenharmony_ci Allowed usage of GL_COLOR_INDEX as a generic format in 5085bd8deadSopenharmony_ci proxy queries for determining an optimal index size for a particular 5095bd8deadSopenharmony_ci texture. 5105bd8deadSopenharmony_ci 5115bd8deadSopenharmony_ci Disallowed CopyTexImage and CopyTexSubImage to paletted 5125bd8deadSopenharmony_ci formats. 5135bd8deadSopenharmony_ci 5145bd8deadSopenharmony_ci Deleted mention of index transfer operations during GetTexImage with 5155bd8deadSopenharmony_ci paletted formats. 5165bd8deadSopenharmony_ci 5175bd8deadSopenharmony_ciChanges due to ARB_texture_cube_map, revision 1.1, June 27, 2002 (Mark Kilgard) 5185bd8deadSopenharmony_ci Add language to section 5.4 about proxy texture tokens for ColorTable 5195bd8deadSopenharmony_ci executing immediately. 5205bd8deadSopenharmony_ci 5215bd8deadSopenharmony_ci Document ARB_texture_cube_map interactions. 5225bd8deadSopenharmony_ci 5235bd8deadSopenharmony_ci Document texture target usage for ColorTable API. 5245bd8deadSopenharmony_ci 5255bd8deadSopenharmony_ci Add "New State" section with table and "New Implementation Dependent 5265bd8deadSopenharmony_ci State" sections. 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ciChanges when incorporating into the registry, September 4, 2002 (Jon Leech) 5295bd8deadSopenharmony_ci Added missing IP Status / Contact fields (without bumping the 5305bd8deadSopenharmony_ci revision) and incorporated Mark's changes into the registry. 5315bd8deadSopenharmony_ci 5325bd8deadSopenharmony_ciChanges, revision 1.4, March 24, 2004 (Mark Kilgard) 5335bd8deadSopenharmony_ci Document vendor support for this extension; note that future NVIDIA 5345bd8deadSopenharmony_ci GPU designs will not support this extension. 535