15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci SGIS_pixel_texture 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_SGIS_pixel_texture 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciVersion 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Last Modified Date: July 15, 1998 125bd8deadSopenharmony_ci Author Revision: $Header: //depot/main/doc/registry/extensions/SGI/pixel_texture.spec#14 $ 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciNumber 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci 15 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciDependencies 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci None 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciOverview 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci The geometry rasterization and pixel pipeline "convert to fragment" 255bd8deadSopenharmony_ci stages each produce fragments. The fragments are processed by 265bd8deadSopenharmony_ci a unified per fragment pipeline that begins with the application 275bd8deadSopenharmony_ci of the texture to the fragment color. Because the pixel pipeline 285bd8deadSopenharmony_ci shares the per fragment processing with the geometry pipeline, the 295bd8deadSopenharmony_ci fragments produced by the pixel pipeline must have the same fields 305bd8deadSopenharmony_ci as the ones produced by the geometry pipeline. When 315bd8deadSopenharmony_ci pixel groups are being converted to fragments, the parts 325bd8deadSopenharmony_ci of the fragment that aren't derived from the pixel groups 335bd8deadSopenharmony_ci are taken from the associated values in the current raster position. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci A fragment consists of x and y window coordinates and their 365bd8deadSopenharmony_ci associated color value, depth value, and texture coordinates. 375bd8deadSopenharmony_ci In the 1.1 OpenGL specification, when the pixel group is RGBA 385bd8deadSopenharmony_ci the fragment color is always derived from the pixel group, 395bd8deadSopenharmony_ci and the depth value and texture coordinates always come 405bd8deadSopenharmony_ci from the raster position. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci This extension provides a way to specify how the texture coordinates 435bd8deadSopenharmony_ci of the fragments can be derived from RGBA pixel groups. When 445bd8deadSopenharmony_ci this option is enabled, the source of the fragment color value 455bd8deadSopenharmony_ci when the pixel group is RGBA can be specified to come from either 465bd8deadSopenharmony_ci the raster position or the pixel group. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci Deriving the fragment texture coordinates from the pixel group 495bd8deadSopenharmony_ci effectively converts a color image into a texture coordinate image. 505bd8deadSopenharmony_ci The multidimensional texture mapping lookup logic also makes this 515bd8deadSopenharmony_ci extension useful for implementing multidimensional color lookups. 525bd8deadSopenharmony_ci Multidimensional color lookups can be used to implement very 535bd8deadSopenharmony_ci accurate color space conversions. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Deriving texture coordinates from the pixel groups in the pixel 565bd8deadSopenharmony_ci pipeline introduces a problem with the lambda parameter in the 575bd8deadSopenharmony_ci texture mapping equations. When texture coordinates are 585bd8deadSopenharmony_ci being taken from the current raster position texture coordinates, 595bd8deadSopenharmony_ci the texture coordinate values don't change from pixel to pixel, 605bd8deadSopenharmony_ci and the equation for calculating lambda always produces zero. 615bd8deadSopenharmony_ci Enabling pixel_texture introduces changes in the texture 625bd8deadSopenharmony_ci coordinates from pixel to pixel which are not necessarily 635bd8deadSopenharmony_ci meaningful for texture lookups. This problem is addressed 645bd8deadSopenharmony_ci by specifying that lambda is always set to zero when pixel_texture 655bd8deadSopenharmony_ci is enabled. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ciIssues 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci * Why do we need the named param? 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci Originally the single mode parameter was sufficient to control 725bd8deadSopenharmony_ci the fragment's color source. However, new extensions (currently 735bd8deadSopenharmony_ci lod and bit and possibly more in the future) introduce 745bd8deadSopenharmony_ci additional ways to manipulate the way pixel texture operates. 755bd8deadSopenharmony_ci These extensions modify the behavior of functionality which 765bd8deadSopenharmony_ci is orthogonal to the functionality modified by this extension, 775bd8deadSopenharmony_ci so multiple pixel_texture parameters are needed. The named 785bd8deadSopenharmony_ci parameter provides a way to set the multiple pixel_texture 795bd8deadSopenharmony_ci parameters. 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci * Should LOD be supported? 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci This has been addressed by the GL_SGIX_pixel_texture_lod extension. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci * The fragment color source can be viewed as having its own 865bd8deadSopenharmony_ci distinct functionality separate from the role it plays in 875bd8deadSopenharmony_ci PIXEL_TEXTURE_SGIS. Should it have its own extension? 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci No. 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci * We chose the name PixelTexGenParameterSGIS because PixelTexGenSGIX 925bd8deadSopenharmony_ci has already been taken by the impact_pixel_texture extension. 935bd8deadSopenharmony_ci Should the name be TexGenParam rather than PixelTexGenParam? 945bd8deadSopenharmony_ci TexGenParam would then be used to expand either geometry texgen 955bd8deadSopenharmony_ci functionality or pixel_texture functionality. Or can we get 965bd8deadSopenharmony_ci away with using PixelTexGen{if}? 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Use PixelTexGenParameteriSGIS and PixelTexGenParameterivSGIS. 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci * Should the PIXEL_TEXTURE_SGIS pipeline include a texture matrix? 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci No. The color matrix can be used if needed. 1035bd8deadSopenharmony_ci The texture matrix takes place during geometry rasterization -- 1045bd8deadSopenharmony_ci it's nice to keep that part of the pipeline separate 1055bd8deadSopenharmony_ci from the pixel part. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci * Do we need to include PixelTexGenParameter{if}vSGIS to be 1085bd8deadSopenharmony_ci complete? 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci Yes. This will make things less confusing if future 1115bd8deadSopenharmony_ci extensions want to define a float named param. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ciNew Procedures and Functions 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci void PixelTexGenParameter{if}SGIS(enum pname, T param); 1165bd8deadSopenharmony_ci void GetPixelTexGenParameter{if}vSGIS(enum pname, T params); 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ciNew Tokens 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and 1215bd8deadSopenharmony_ci by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and 1225bd8deadSopenharmony_ci GetDoublev: 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci PIXEL_TEXTURE_SGIS = 0x8353 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci Accepted by the <pname> parameter of PixelTexGenParameteriSGIS 1275bd8deadSopenharmony_ci and GetPixelTexGenParameterivSGIS: 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354 1305bd8deadSopenharmony_ci PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci Accepted by the <param> parameter of PixelTexGenParameteriSGIS: 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci PIXEL_GROUP_COLOR_SGIS = 0x8356 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci None 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization) 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci This extension modifies the "Conversion to Fragments" subsection of 1435bd8deadSopenharmony_ci section 3.6.3 (Rasterization of Pixel Rectangles) of the GL 1445bd8deadSopenharmony_ci Specification. The paragraph beginning with "A fragment 1455bd8deadSopenharmony_ci arising from a group..." ends with "color and texture coordinates 1465bd8deadSopenharmony_ci are given by those associated with the current raster position." 1475bd8deadSopenharmony_ci The rest of the paragraph, beginning with "In both cases texture 1485bd8deadSopenharmony_ci coordinates..." is replaced with the following: 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci In all cases texture coordinates s, t, and r are replaced with 1515bd8deadSopenharmony_ci s/q, t/q, and r/q, respectively. If q is less than or equal to 1525bd8deadSopenharmony_ci zero, the results are undefined. Groups arising from DrawPixels 1535bd8deadSopenharmony_ci with a format of STENCIL_INDEX are treated specially and 1545bd8deadSopenharmony_ci are described in section 4.3.1. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci The treatment of fragments arising from groups consisting of RGBA color 1575bd8deadSopenharmony_ci data is affected by PIXEL_TEXTURE_SGIS, which is enabled and disabled by 1585bd8deadSopenharmony_ci calling Enable and Disable with PIXEL_TEXTURE_SGIS passed as the <cap> 1595bd8deadSopenharmony_ci parameter. 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci When PIXEL_TEXTURE_SGIS is enabled, a fragment arising from 1625bd8deadSopenharmony_ci a group consisting of RGBA color data takes its depth component 1635bd8deadSopenharmony_ci from the current raster position depth, and the texture coordinates 1645bd8deadSopenharmony_ci are assigned as follows: 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci Pixel group's red becomes the fragment S texture coordinate 1675bd8deadSopenharmony_ci Pixel group's green becomes the fragment T texture coordinate 1685bd8deadSopenharmony_ci Pixel group's blue becomes the fragment R texture coordinate 1695bd8deadSopenharmony_ci Pixel group's alpha becomes the fragment Q texture coordinate 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci The default operation is to set the texture coordinate value to 1725bd8deadSopenharmony_ci the color component value with no conversion. 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci Various parameters control how the fragment is derived from 1755bd8deadSopenharmony_ci the pixel group when PIXEL_TEXTURE_SGIS is enabled. 1765bd8deadSopenharmony_ci Each parameter is set by calling 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci PixelTexGenParameter{if}(enum pname, T param) ; 1795bd8deadSopenharmony_ci PixelTexGenParameter{if}v(enum pname, T params) ; 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci The parameter pname is a symbolic constant indicating the parameter to be 1825bd8deadSopenharmony_ci set. In the first form of the command, params is value to which 1835bd8deadSopenharmony_ci to set a single-valued parameter; in the second form of the 1845bd8deadSopenharmony_ci command, params is an array of parameters whose type depends 1855bd8deadSopenharmony_ci on the parameter being set. 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci If pname is PIXEL_FRAGMENT_RGB_SOURCE_SGIS or 1885bd8deadSopenharmony_ci PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS, param is an integer 1895bd8deadSopenharmony_ci that is one of the symbolic constants CURRENT_RASTER_COLOR or 1905bd8deadSopenharmony_ci PIXEL_GROUP_COLOR_SGIS. 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci The assignment of the fragment color components when PIXEL_TEXTURE_SGIS 1935bd8deadSopenharmony_ci is enabled is determined by the values of PIXEL_FRAGMENT_RGB_SOURCE_SGIS 1945bd8deadSopenharmony_ci and PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS as defined by the following tables: 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci PIXEL_FRAGMENT_RGB_SOURCE_SGIS Resulting fragment RGB 1975bd8deadSopenharmony_ci ------------------------------ ---------------------- 1985bd8deadSopenharmony_ci CURRENT_RASTER_COLOR CRP's RGB 1995bd8deadSopenharmony_ci PIXEL_GROUP_COLOR_SGIS PG's RGB 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS Resulting fragment A 2025bd8deadSopenharmony_ci -------------------------------- -------------------- 2035bd8deadSopenharmony_ci CURRENT_RASTER_COLOR CRP's A 2045bd8deadSopenharmony_ci PIXEL_GROUP_COLOR_SGIS PG's A 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci PG, CRP, R, G, B, A are abbreviations of "current raster 2075bd8deadSopenharmony_ci position", "pixel group", "red", "green", "blue", and "alpha" 2085bd8deadSopenharmony_ci respectively. 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci When the pixel_texture extension is enabled, the lambda 2115bd8deadSopenharmony_ci value used in the texture mapping equations is set to zero. 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 2145bd8deadSopenharmony_ciand the Frame Buffer) 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci The operation of PIXEL_TEXTURE_SGIS during pixel copy operations is 2175bd8deadSopenharmony_ci identical to the operation during pixel drawing. 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions) 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci The following commands are not included in display lists: 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci GetPixelTexGenParameter{if}vSGIS 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests) 2265bd8deadSopenharmony_ci 2275bd8deadSopenharmony_ci Add to the list of Get commands following the paragraph starting 2285bd8deadSopenharmony_ci with "Other commands exist to obtain state variables that are 2295bd8deadSopenharmony_ci indexed by a target...": 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ci GetPixelTexGenParameter{if}vSGIS( enum value, T data ); 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci Change the phrase a few paragraph later "GetMaterial, GetTexGen, 2345bd8deadSopenharmony_ci GetTexEnv, and GetTexParameter are similar to GetLight, 2355bd8deadSopenharmony_ci placing information..." to "GetMaterial, GetTexGen, GetTexEnv, 2365bd8deadSopenharmony_ci GetTexParameter, and GetPixelTexGenParameter{if}vSGIS 2375bd8deadSopenharmony_ci are similar to GetLight, placing information..." 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ciAdditions to the GLX Specification 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ci None 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ciErrors 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci INVALID_ENUM is generated if PixelTexGenParameterSGIS parameter <pname> 2465bd8deadSopenharmony_ci is not PIXEL_FRAGMENT_RGB_SOURCE_SGIS or PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS. 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci INVALID_ENUM is generated if PixelTexGenParameterSGIS parameter <pname> 2495bd8deadSopenharmony_ci is one of PIXEL_FRAGMENT_RGB_SOURCE_SGIS or 2505bd8deadSopenharmony_ci PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS and parameter <param> is not 2515bd8deadSopenharmony_ci CURRENT_RASTER_COLOR or PIXEL_GROUP_COLOR_SGIS. 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci INVALID_OPERATION is generated if PixelTexGenParameteriSGIS, 2545bd8deadSopenharmony_ci PixelTexGenParameterivSGIS, or GetPixelTexGenParameterivSGIS 2555bd8deadSopenharmony_ci are called between the execution of Begin and the execution 2565bd8deadSopenharmony_ci of the corresponding End. 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ciNew State 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ci The following is added to Table 6.16. Pixels. 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attrib 2635bd8deadSopenharmony_ci --------- ----------- ---- ------------- ------ 2645bd8deadSopenharmony_ci PIXEL_TEXTURE_SGIS IsEnabled B FALSE pixel/enable 2655bd8deadSopenharmony_ci PIXEL_FRAGMENT_RGB_SOURCE_SGIS GetPixelTexGenParameterivSGIS Z2 PIXEL_GROUP_COLOR_SGIS pixel 2665bd8deadSopenharmony_ci PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS GetPixelTexGenParameterivSGIS Z2 PIXEL_GROUP_COLOR_SGIS pixel 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ciNew Implementation Dependent State 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci None 271