15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci SGIS_texture_lod 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_SGIS_texture_lod 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciVersion 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci $Date: 1997/05/30 01:34:44 $ $Revision: 1.8 $ 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNumber 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci 24 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciDependencies 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci EXT_texture is required 205bd8deadSopenharmony_ci EXT_texture3D affects the definition of this extension 215bd8deadSopenharmony_ci EXT_texture_object affects the definition of this extension 225bd8deadSopenharmony_ci SGI_detail_texture affects the definition of this extension 235bd8deadSopenharmony_ci SGI_sharpen_texture affects the definition of this extension 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciOverview 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci This extension imposes two constraints related to the texture level of 285bd8deadSopenharmony_ci detail parameter LOD, which is represented by the Greek character lambda 295bd8deadSopenharmony_ci in the GL Specification. One constraint clamps LOD to a specified 305bd8deadSopenharmony_ci floating point range. The other limits the selection of mipmap image 315bd8deadSopenharmony_ci arrays to a subset of the arrays that would otherwise be considered. 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci Together these constraints allow a large texture to be loaded and 345bd8deadSopenharmony_ci used initially at low resolution, and to have its resolution raised 355bd8deadSopenharmony_ci gradually as more resolution is desired or available. Image array 365bd8deadSopenharmony_ci specification is necessarily integral, rather than continuous. By 375bd8deadSopenharmony_ci providing separate, continuous clamping of the LOD parameter, it is 385bd8deadSopenharmony_ci possible to avoid "popping" artifacts when higher resolution images 395bd8deadSopenharmony_ci are provided. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci Note: because the shape of the mipmap array is always determined by 425bd8deadSopenharmony_ci the dimensions of the level 0 array, this array must be loaded for 435bd8deadSopenharmony_ci mipmapping to be active. If the level 0 array is specified with a 445bd8deadSopenharmony_ci null image pointer, however, no actual data transfer will take 455bd8deadSopenharmony_ci place. And a sufficiently tuned implementation might not even 465bd8deadSopenharmony_ci allocate space for a level 0 array so specified until true image 475bd8deadSopenharmony_ci data were presented. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ciIssues 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci * Should detail and sharpen texture operate when the level 0 image 525bd8deadSopenharmony_ci is not being used? 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci A: Sharpen yes, detail no. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci * Should the shape of the mipmap array be determined by the 575bd8deadSopenharmony_ci dimensions of the level 0 array, regardless of the base level? 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci A: Yes, this is the better solution. Driving everything from 605bd8deadSopenharmony_ci the base level breaks the proxy query process, and allows 615bd8deadSopenharmony_ci mipmap arrays to be placed arbitrarily. The issues of 625bd8deadSopenharmony_ci requiring a level 0 array are partially overcome by the use 635bd8deadSopenharmony_ci of null-point loads, which avoid data transfer and, 645bd8deadSopenharmony_ci potentially, data storage allocation. 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci * With the arithmetic as it is, a linear filter might access an 675bd8deadSopenharmony_ci array past the limit specified by MAX_LEVEL or p. But the 685bd8deadSopenharmony_ci results of this access are not significant, because the blend 695bd8deadSopenharmony_ci will weight them as zero. 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ciNew Procedures and Functions 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci None 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ciNew Tokens 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci Accepted by the <pname> parameter of TexParameteri, TexParameterf, 785bd8deadSopenharmony_ci TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv: 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci TEXTURE_MIN_LOD_SGIS 0x813A 815bd8deadSopenharmony_ci TEXTURE_MAX_LOD_SGIS 0x813B 825bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL_SGIS 0x813C 835bd8deadSopenharmony_ci TEXTURE_MAX_LEVEL_SGIS 0x813D 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci None 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization) 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci GL Specification Table 3.7 is updated as follows: 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci Name Type Legal Values 945bd8deadSopenharmony_ci ---- ---- ------------ 955bd8deadSopenharmony_ci TEXTURE_WRAP_S integer CLAMP, REPEAT 965bd8deadSopenharmony_ci TEXTURE_WRAP_T integer CLAMP, REPEAT 975bd8deadSopenharmony_ci TEXTURE_WRAP_R_EXT integer CLAMP, REPEAT 985bd8deadSopenharmony_ci TEXTURE_MIN_FILTER integer NEAREST, LINEAR, 995bd8deadSopenharmony_ci NEAREST_MIPMAP_NEAREST, 1005bd8deadSopenharmony_ci NEAREST_MIPMAP_LINEAR, 1015bd8deadSopenharmony_ci LINEAR_MIPMAP_NEAREST, 1025bd8deadSopenharmony_ci LINEAR_MIPMAP_LINEAR, 1035bd8deadSopenharmony_ci FILTER4_SGIS 1045bd8deadSopenharmony_ci TEXTURE_MAG_FILTER integer NEAREST, LINEAR, 1055bd8deadSopenharmony_ci FILTER4_SGIS, 1065bd8deadSopenharmony_ci LINEAR_DETAIL_SGIS, 1075bd8deadSopenharmony_ci LINEAR_DETAIL_ALPHA_SGIS, 1085bd8deadSopenharmony_ci LINEAR_DETAIL_COLOR_SGIS, 1095bd8deadSopenharmony_ci LINEAR_SHARPEN_SGIS, 1105bd8deadSopenharmony_ci LINEAR_SHARPEN_ALPHA_SGIS, 1115bd8deadSopenharmony_ci LINEAR_SHARPEN_COLOR_SGIS 1125bd8deadSopenharmony_ci TEXTURE_BORDER_COLOR 4 floats any 4 values in [0,1] 1135bd8deadSopenharmony_ci DETAIL_TEXTURE_LEVEL_SGIS integer any non-negative integer 1145bd8deadSopenharmony_ci DETAIL_TEXTURE_MODE_SGIS integer ADD, MODULATE 1155bd8deadSopenharmony_ci TEXTURE_MIN_LOD_SGIS float any value 1165bd8deadSopenharmony_ci TEXTURE_MAX_LOD_SGIS float any value 1175bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL_SGIS integer any non-negative integer 1185bd8deadSopenharmony_ci TEXTURE_MAX_LEVEL_SGIS integer any non-negative integer 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Table 3.7: Texture parameters and their values. 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci Base Array 1235bd8deadSopenharmony_ci ---------- 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci Although it is not explicitly stated, it is the clear intention 1265bd8deadSopenharmony_ci of the OpenGL specification that texture minification filters 1275bd8deadSopenharmony_ci NEAREST and LINEAR, and all texture magnification filters, be 1285bd8deadSopenharmony_ci applied to image array zero. This extension introduces a 1295bd8deadSopenharmony_ci parameter, BASE_LEVEL, that explicitly specifies which array 1305bd8deadSopenharmony_ci level is used for these filter operations. Base level is specified 1315bd8deadSopenharmony_ci for a specific texture by calling TexParameteri, TexParameterf, 1325bd8deadSopenharmony_ci TexParameteriv, or TexParameterfv with <target> set to TEXTURE_1D, 1335bd8deadSopenharmony_ci TEXTURE_2D, or TEXTURE_3D_EXT, <pname> set to TEXTURE_BASE_LEVEL_SGIS, 1345bd8deadSopenharmony_ci and <param> set to (or <params> pointing to) the desired value. The 1355bd8deadSopenharmony_ci error INVALID_VALUE is generated if the specified BASE_LEVEL is 1365bd8deadSopenharmony_ci negative. 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci Level of Detail Clamping 1395bd8deadSopenharmony_ci ------------------------ 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci The level of detail parameter LOD is defined in the first paragraph 1425bd8deadSopenharmony_ci of Section 3.8.1 (Texture Minification) of the GL Specification, where 1435bd8deadSopenharmony_ci it is represented by the Greek character lambda. This extension 1445bd8deadSopenharmony_ci redefines the definition of LOD as follows: 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci LOD'(x,y) = log_base_2 (Q(x,y)) 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci / MAX_LOD LOD' > MAX_LOD 1505bd8deadSopenharmony_ci LOD = ( LOD' LOD' >= MIN_LOD and LOD' <= MAX_LOD 1515bd8deadSopenharmony_ci \ MIN_LOD LOD' < MIN_LOD 1525bd8deadSopenharmony_ci \ undefined MIN_LOD > MAX_LOD 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci The variable Q in this definition represents the Greek character rho, 1555bd8deadSopenharmony_ci as it is used in the OpenGL Specification. (Recall that Q is computed 1565bd8deadSopenharmony_ci based on the dimensions of the BASE_LEVEL image array.) MIN_LOD is the 1575bd8deadSopenharmony_ci value of the per-texture variable TEXTURE_MIN_LOD_SGIS, and MAX_LOD is 1585bd8deadSopenharmony_ci the value of the per-texture variable TEXTURE_MAX_LOD_SGIS. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci Initially TEXTURE_MIN_LOD_SGIS and TEXTURE_MAX_LOD_SGIS are -1000 and 1615bd8deadSopenharmony_ci 1000 respectively, so they do not interfere with the normal operation of 1625bd8deadSopenharmony_ci texture mapping. These values are respecified for a specific texture 1635bd8deadSopenharmony_ci by calling TexParameteri, TexParemeterf, TexParameteriv, or 1645bd8deadSopenharmony_ci TexParameterfv with <target> set to TEXTURE_1D, TEXTURE_2D, or 1655bd8deadSopenharmony_ci TEXTURE_3D_EXT, <pname> set to TEXTURE_MIN_LOD_SGIS or 1665bd8deadSopenharmony_ci TEXTURE_MAX_LOD_SGIS, and <param> set to (or <params> pointing to) the 1675bd8deadSopenharmony_ci new value. It is not an error to specify a maximum LOD value that is 1685bd8deadSopenharmony_ci less than the minimum LOD value, but the resulting LOD values are 1695bd8deadSopenharmony_ci not defined. 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci LOD is clamped to the specified range prior to any use. Specifically, 1725bd8deadSopenharmony_ci the mipmap image array selection described in the Mipmapping Subsection 1735bd8deadSopenharmony_ci of the GL Specification is based on the clamped LOD value. Also, the 1745bd8deadSopenharmony_ci determination of whether the minification or magnification filter is 1755bd8deadSopenharmony_ci used is based on the clamped LOD. 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci Mipmap Completeness 1785bd8deadSopenharmony_ci ------------------- 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci The GL Specification describes a "complete" set of mipmap image arrays 1815bd8deadSopenharmony_ci as array levels 0 through p, where p is a well defined function of the 1825bd8deadSopenharmony_ci dimensions of the level 0 image. This extension modifies the notion 1835bd8deadSopenharmony_ci of completeness: instead of requiring that all arrays 0 through p 1845bd8deadSopenharmony_ci meet the requirements, only arrays 0 and arrays BASE_LEVEL through 1855bd8deadSopenharmony_ci MAX_LEVEL (or p, whichever is smaller) must meet these requirements. 1865bd8deadSopenharmony_ci The specification of BASE_LEVEL was described above. MAX_LEVEL is 1875bd8deadSopenharmony_ci specified by calling TexParameteri, TexParemeterf, TexParameteriv, or 1885bd8deadSopenharmony_ci TexParameterfv with <target> set to TEXTURE_1D, TEXTURE_2D, or 1895bd8deadSopenharmony_ci TEXTURE_3D_EXT, <pname> set to TEXTURE_MAX_LEVEL_SGIS, and <param> set 1905bd8deadSopenharmony_ci to (or <params> pointing to) the desired value. The error 1915bd8deadSopenharmony_ci INVALID_VALUE is generated if the specified MAX_LEVEL is negative. 1925bd8deadSopenharmony_ci If MAX_LEVEL is smaller than BASE_LEVEL, or if BASE_LEVEL is greater 1935bd8deadSopenharmony_ci than p, the set of arrays is incomplete. 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci Array Selection 1965bd8deadSopenharmony_ci --------------- 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci Magnification and non-mipmapped minification are always performed 1995bd8deadSopenharmony_ci using only the BASE_LEVEL image array. If the minification filter 2005bd8deadSopenharmony_ci is one that requires mipmapping, one or two array levels are 2015bd8deadSopenharmony_ci selected using the equations in the table below, and the LOD value 2025bd8deadSopenharmony_ci is clamped to a maximum value that insures that no array beyond 2035bd8deadSopenharmony_ci the limits specified by MAX_LEVEL and p is accessed. 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci Minification Filter Maximum LOD Array level(s) 2065bd8deadSopenharmony_ci ------------------- ----------- -------------- 2075bd8deadSopenharmony_ci NEAREST_MIPMAP_NEAREST M + 0.4999 floor(B + 0.5) 2085bd8deadSopenharmony_ci LINEAR_MIPMAP_NEAREST M + 0.4999 floor(B + 0.5) 2095bd8deadSopenharmony_ci NEAREST_MIPMAP_LINEAR M floor(B), floor(B)+1 2105bd8deadSopenharmony_ci LINEAR_MIPMAP_LINEAR M floor(B), floor(B)+1 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci where: 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci M = min(MAX_LEVEL,p) - BASE_LEVEL 2155bd8deadSopenharmony_ci B = BASE_LEVEL + LOD 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci For NEAREST_MIPMAP_NEAREST and LINEAR_MIPMAP_NEAREST the specified 2185bd8deadSopenharmony_ci image array is filtered according to the rules for NEAREST or 2195bd8deadSopenharmony_ci LINEAR respectively. For NEAREST_MIPMAP_LINEAR and 2205bd8deadSopenharmony_ci LINEAR_MIPMAP_LINEAR both selected arrays are filtered according to 2215bd8deadSopenharmony_ci the rules for NEAREST or LINEAR, respectively. The resulting values 2225bd8deadSopenharmony_ci are then blended as described in the Mipmapping section of the 2235bd8deadSopenharmony_ci OpenGL specification. 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci Additional Filters 2265bd8deadSopenharmony_ci ------------------ 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci Sharpen filters (described in SGIS_sharpen_texture) operate on array 2295bd8deadSopenharmony_ci levels BASE_LEVEL and BASE_LEVEL+1. If the minimum of MAX_LEVEL and p 2305bd8deadSopenharmony_ci is not greater than BASE_LEVEL, then sharpen texture reverts to a 2315bd8deadSopenharmony_ci LINEAR magnification filter. Detail filters (described in 2325bd8deadSopenharmony_ci SGIS_detail_texture) operate only when BASE_LEVEL is zero. 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci Texture Capacity 2355bd8deadSopenharmony_ci ---------------- 2365bd8deadSopenharmony_ci 2375bd8deadSopenharmony_ci In Section 3.8 the OpenGL specification states: 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci "In order to allow the client to meaningfully query the maximum 2405bd8deadSopenharmony_ci image array sizes that are supported, an implementation must not 2415bd8deadSopenharmony_ci allow an image array of level one or greater to be created if a 2425bd8deadSopenharmony_ci `complete' set of image arrays consistent with the requested 2435bd8deadSopenharmony_ci array could not be supported." 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci Given this extension's redefinition of completeness, the above 2465bd8deadSopenharmony_ci paragraph should be rewritten to indicate that all levels of the 2475bd8deadSopenharmony_ci `complete' set of arrays must be supportable. E.g. 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci "In order to allow the client to meaningfully query the maximum 2505bd8deadSopenharmony_ci image array sizes that are supported, an implementation must not 2515bd8deadSopenharmony_ci allow an image array of level one or greater to be created if a 2525bd8deadSopenharmony_ci `complete' set of image arrays (all levels 0 through p) consistent 2535bd8deadSopenharmony_ci with the requested array could not be supported." 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 2565bd8deadSopenharmony_ciand the Frame Buffer) 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ci None 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions) 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci None 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests) 2655bd8deadSopenharmony_ci 2665bd8deadSopenharmony_ci None 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ciAdditions to the GLX Specification 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci None 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ciDependencies on EXT_texture 2735bd8deadSopenharmony_ci 2745bd8deadSopenharmony_ci EXT_texture is required. 2755bd8deadSopenharmony_ci 2765bd8deadSopenharmony_ciDependencies on EXT_texture3D 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci If EXT_texture3D is not supported, references to 3D texture mapping and 2795bd8deadSopenharmony_ci to TEXTURE_3D_EXT in this document are invalid and should be ignored. 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ciDependencies on EXT_texture_object 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci If EXT_texture_object is implemented, the state values named 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci TEXTURE_MIN_LOD_SGIS 2865bd8deadSopenharmony_ci TEXTURE_MAX_LOD_SGIS 2875bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL_SGIS 2885bd8deadSopenharmony_ci TEXTURE_MAX_LEVEL_SGIS 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci are added to the state vector of each texture object. When an attribute 2915bd8deadSopenharmony_ci set that includes texture information is popped, the bindings and 2925bd8deadSopenharmony_ci enables are first restored to their pushed values, then the bound 2935bd8deadSopenharmony_ci textures have their LOD and LEVEL parameters restored to their pushed 2945bd8deadSopenharmony_ci values. 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ciDependencies on SGIS_detail_texture 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci If SGIS_detail_texture is not supported, references to detail texture 2995bd8deadSopenharmony_ci mapping in this document are invalid and should be ignored. 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ciDependencies on SGIS_sharpen_texture 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci If SGIS_sharpen_texture is not supported, references to sharpen texture 3045bd8deadSopenharmony_ci mapping in this document are invalid and should be ignored. 3055bd8deadSopenharmony_ci 3065bd8deadSopenharmony_ciErrors 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci INVALID_VALUE is generated if an attempt is made to set 3095bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL_SGIS or TEXTURE_MAX_LEVEL_SGIS to a negative value. 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ciNew State 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci Initial 3145bd8deadSopenharmony_ci Get Value Get Command Type Value Attrib 3155bd8deadSopenharmony_ci --------- ----------- ---- ------- ------ 3165bd8deadSopenharmony_ci TEXTURE_MIN_LOD_SGIS GetTexParameterfv n x R -1000 texture 3175bd8deadSopenharmony_ci TEXTURE_MAX_LOD_SGIS GetTexParameterfv n x R 1000 texture 3185bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL_SGIS GetTexParameteriv n x R 0 texture 3195bd8deadSopenharmony_ci TEXTURE_MAX_LEVEL_SGIS GetTexParameteriv n x R 1000 texture 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ciNew Implementation Dependent State 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci None 324