15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_texgen_reflection 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_texgen_reflection 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright NVIDIA Corporation, 1999. 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciStatus 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Shipping (version 1.0) 205bd8deadSopenharmony_ci NVIDIA, Mesa 3.1, and ATI support this. 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci This extension's texture coordinate generation functionality is 235bd8deadSopenharmony_ci incoporated into the ARB_texture_cube_map extension. The same 245bd8deadSopenharmony_ci enumerant values are used. 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci The ARB_texture_cube_map functionality, including this texgen 275bd8deadSopenharmony_ci reflection functionality, is part of OpenGL 1.3 and subsequent 285bd8deadSopenharmony_ci revisions of the core OpenGL standard. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ciVersion 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ci June 17, 2003 (version 1.0) 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ciNumber 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci 179 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciDependencies 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci Written based on the wording of the OpenGL 1.2 specification but 415bd8deadSopenharmony_ci not dependent on it. 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ciOverview 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci This extension provides two new texture coordinate generation modes 465bd8deadSopenharmony_ci that are useful texture-based lighting and environment mapping. 475bd8deadSopenharmony_ci The reflection map mode generates texture coordinates (s,t,r) 485bd8deadSopenharmony_ci matching the vertex's eye-space reflection vector. The reflection 495bd8deadSopenharmony_ci map mode is useful for environment mapping without the singularity 505bd8deadSopenharmony_ci inherent in sphere mapping. The normal map mode generates texture 515bd8deadSopenharmony_ci coordinates (s,t,r) matching the vertex's transformed eye-space 525bd8deadSopenharmony_ci normal. The normal map mode is useful for sophisticated cube map 535bd8deadSopenharmony_ci texturing-based diffuse lighting models. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciIssues 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci Should we place the normal/reflection vector in the (s,t,r) texture 585bd8deadSopenharmony_ci coordinates or (s,t,q) coordinates? 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci RESOLUTION: (s,t,r). Even if the proposed hardware uses "q" for 615bd8deadSopenharmony_ci the third component, the API should claim to support generation of 625bd8deadSopenharmony_ci (s,t,r) and let the texture matrix (through a concatenation with 635bd8deadSopenharmony_ci the user-supplied texture matrix) move "r" into "q". 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci Should you be able to have some texture coordinates computing 665bd8deadSopenharmony_ci REFLECTION_MAP_NV and others not? Same question with NORMAL_MAP_NV. 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci RESOLUTION: YES. This is the way that SPHERE_MAP works. It is 695bd8deadSopenharmony_ci not clear that this would ever be useful though. 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci Should something special be said about the handling of the q 725bd8deadSopenharmony_ci texture coordinate for this spec? 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci RESOLUTION: NO. But the following paragraph is useful for 755bd8deadSopenharmony_ci implementors concerned about the handling of q. 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci The REFLECTION_MAP_NV and NORMAL_MAP_NV modes are intended to supply 785bd8deadSopenharmony_ci reflection and normal vectors for cube map texturing hardware. 795bd8deadSopenharmony_ci When these modes are used for cube map texturing, the generated 805bd8deadSopenharmony_ci texture coordinates can be thought of as a reflection vector. 815bd8deadSopenharmony_ci The value of the q texture coordinate then simply scales the 825bd8deadSopenharmony_ci vector but does not change its direction. Because only the vector 835bd8deadSopenharmony_ci direction (not the vector magnitude) matters for cube map texturing, 845bd8deadSopenharmony_ci implementations are free to leave q undefined when any of the s, 855bd8deadSopenharmony_ci t, or r texture coordinates are generated using REFLECTION_MAP_NV 865bd8deadSopenharmony_ci or NORMAL_MAP_NV. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ciNew Procedures and Functions 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci None 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ciNew Tokens 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci Accepted by the <param> parameters of TexGend, TexGenf, and TexGeni 955bd8deadSopenharmony_ci when <pname> parameter is TEXTURE_GEN_MODE: 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci NORMAL_MAP_NV 0x8511 985bd8deadSopenharmony_ci REFLECTION_MAP_NV 0x8512 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci When the <pname> parameter of TexGendv, TexGenfv, and TexGeniv is 1015bd8deadSopenharmony_ci TEXTURE_GEN_MODE, then the array <params> may also contain 1025bd8deadSopenharmony_ci NORMAL_MAP_NV or REFLECTION_MAP_NV. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 Specification (OpenGL Operation) 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci -- Section 2.10.4 "Generating Texture Coordinates" 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci Change the last sentence in the 1st paragraph to: 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci "If <pname> is TEXTURE_GEN_MODE, then either <params> points to 1115bd8deadSopenharmony_ci or <param> is an integer that is one of the symbolic constants 1125bd8deadSopenharmony_ci OBJECT_LINEAR, EYE_LINEAR, SPHERE_MAP, REFLECTION_MAP_NV, or 1135bd8deadSopenharmony_ci NORMAL_MAP_NV." 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci Add these paragraphs after the 4th paragraph: 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci "If TEXTURE_GEN_MODE indicates REFLECTION_MAP_NV, compute the 1185bd8deadSopenharmony_ci reflection vector r as described for the SPHERE_MAP mode. Then the 1195bd8deadSopenharmony_ci value assigned to an s coordinate (the first TexGen argument value 1205bd8deadSopenharmony_ci is S) is s = rx; the value assigned to a t coordinate is t = ry; 1215bd8deadSopenharmony_ci and the value assigned to a r coordinate is r = rz. Calling TexGen 1225bd8deadSopenharmony_ci with a <coord> of Q when <pname> indicates REFLECTION_MAP_NV 1235bd8deadSopenharmony_ci generates the error INVALID_ENUM. 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci If TEXTURE_GEN_MODE indicates NORMAL_MAP_NV, compute the normal 1265bd8deadSopenharmony_ci vector n' as described in section 2.10.3. Then the value assigned 1275bd8deadSopenharmony_ci to an s coordinate (the first TexGen argument value is S) is s = 1285bd8deadSopenharmony_ci nfx; the value assigned to a t coordinate is t = nfy; and the 1295bd8deadSopenharmony_ci value assigned to a r coordinate is r = nfz. (The values nfx, nfy, 1305bd8deadSopenharmony_ci and nfz are the components of nf.) Calling TexGen with a <coord> 1315bd8deadSopenharmony_ci of Q when <pname> indicates REFLECTION_MAP_NV generates the error 1325bd8deadSopenharmony_ci INVALID_ENUM. 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci The last paragraph's first sentence should be changed to: 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci "The state required for texture coordinate generation comprises a 1375bd8deadSopenharmony_ci five-valued integer for each coordinate indicating coordinate 1385bd8deadSopenharmony_ci generation mode, ..." 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 Specification (Rasterization) 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci None 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations 1455bd8deadSopenharmony_ciand the Frame Buffer) 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ci None 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 Specification (Special Functions) 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci None 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 Specification (State and State Requests) 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci None 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ciAdditions to the GLX Specification 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci None 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ciErrors 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci INVALID_ENUM is generated when TexGen is called with a <coord> of Q 1645bd8deadSopenharmony_ci when <pname> indicates REFLECTION_MAP_NV or NORMAL_MAP_NV. 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ciNew State 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci(table 6.14, p204) change the entry for TEXTURE_GEN_MODE to: 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Sec Attribute 1715bd8deadSopenharmony_ci --------- ---- ----------- ------------- ----------- ------ --------- 1725bd8deadSopenharmony_ci TEXTURE_GEN_MODE 4xZ5 GetTexGeniv EYE_LINEAR Function used for 2.10.4 texture 1735bd8deadSopenharmony_ci texgen (for s,t,r, 1745bd8deadSopenharmony_ci and q) 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci(the type changes from 4xZ3 to 4xZ5) 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ciNew Implementation State 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci None 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ciRevision History 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci None 185