15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci SUN_global_alpha 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ci 65bd8deadSopenharmony_ciName Strings 75bd8deadSopenharmony_ci 85bd8deadSopenharmony_ci GL_SUN_global_alpha 95bd8deadSopenharmony_ci 105bd8deadSopenharmony_ciContact 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci Jack Middleton, Sun (Jack.Middleton 'at' eng.sun.com) 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciStatus 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Shipping 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciVersion 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci $Date: 1999/12/28 01:40:37 $ $Revision: 1.4 $ 215bd8deadSopenharmony_ci SUN Date: 99/06/25 13:05:48 Revision: 1.7 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciNumber 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci 164 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciDependencies 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL 1.2 is required 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciOverview 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Transparency is done in OpenGL using alpha blending. An alpha value 355bd8deadSopenharmony_ci of 0.0 is used for fully transparent objects, while an alpha value 365bd8deadSopenharmony_ci of 1.0 is used for fully opaque objects. A value of 0.25 is 75% 375bd8deadSopenharmony_ci transparent, and so on. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci OpenGL defines alpha as a component of the vertex color state. 405bd8deadSopenharmony_ci Whenever a color is set, the alpha component is set along with the 415bd8deadSopenharmony_ci red, green, and blue components. This means that transparency 425bd8deadSopenharmony_ci can't be changed for primitives with per-vertex colors without 435bd8deadSopenharmony_ci modifying the color of each vertex, replacing the old alpha 445bd8deadSopenharmony_ci component with the new alpha component. This can be very expensive 455bd8deadSopenharmony_ci for objects that are drawn using vertex arrays; it all but 465bd8deadSopenharmony_ci precludes the use of display lists. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension defines a new global alpha attribute that can be 495bd8deadSopenharmony_ci used to specify an alpha factor that is independent from the alpha 505bd8deadSopenharmony_ci component of the color value. The global alpha factor is 515bd8deadSopenharmony_ci multiplied by the fragment's alpha value after primitive 525bd8deadSopenharmony_ci rasterization and prior to texture mapping, replacing the 535bd8deadSopenharmony_ci fragment's alpha value. The global alpha extension is only 545bd8deadSopenharmony_ci specified in RGBA mode and must be applied prior to any texture 555bd8deadSopenharmony_ci mapping operation. It is enabled by a new GLOBAL_ALPHA flag. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciNew Procedures and Functions 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci void GlobalAlphaFactorbSUN(byte factor); 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci void GlobalAlphaFactorsSUN(short factor); 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci void GlobalAlphaFactoriSUN(int factor); 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci void GlobalAlphaFactorfSUN(float factor); 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci void GlobalAlphaFactordSUN(double factor); 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci void GlobalAlphaFactorubSUN(ubyte factor); 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci void GlobalAlphaFactorusSUN(ushort factor); 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci void GlobalAlphaFactoruiSUN(uint factor); 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ciNew Tokens 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled: 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci GLOBAL_ALPHA_SUN 0x81D9 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci Accepted by the by the <pname> parameter of GetBooleanv, 845bd8deadSopenharmony_ci GetIntegerv, GetFloatv, and GetDoublev: 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci GLOBAL_ALPHA_FACTOR_SUN 0x81DA 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation) 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci None 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ciAdditions to Chapter 3 of the GL Specification (Rasterization) 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci Global alpha processing is a new stage in the rasterization 975bd8deadSopenharmony_ci pipeline that occurs after primitive rasterization (including 985bd8deadSopenharmony_ci pixel rectangles and bitmaps) and before any texture mapping 995bd8deadSopenharmony_ci operations. Global alpha processing is only done in RGBA mode. 1005bd8deadSopenharmony_ci It has no effect in color index mode. 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci Global alpha processing is enabled or disabled with the Enable and 1035bd8deadSopenharmony_ci Disable commands using the symbolic constant GLOBAL_ALPHA_SUN. 1045bd8deadSopenharmony_ci The global alpha factor is set using one of the GlobalAlphaFactor*SUN 1055bd8deadSopenharmony_ci commands listed above. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci If global alpha processing is enabled, then the global alpha factor 1085bd8deadSopenharmony_ci is multiplied by the incoming fragment's alpha value. This 1095bd8deadSopenharmony_ci product replaces the fragment's alpha value and is passed to 1105bd8deadSopenharmony_ci subsequent stages in the pipeline. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Note that for geometric primitives, a functionally equivalent 1135bd8deadSopenharmony_ci method to that of performing a multiplication for each 1145bd8deadSopenharmony_ci fragment is to multiply the alpha values at each vertex of the 1155bd8deadSopenharmony_ci primitive by the global alpha factor prior to the primitive 1165bd8deadSopenharmony_ci rasterization step. 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ciAdditions to Chapter 4 of the GL Specification (Per-Fragment Operations 1205bd8deadSopenharmony_ciand the Framebuffer) 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci None 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ciAdditions to Chapter 5 of the GL Specification (Special Functions) 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci None 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ciAdditions to Chapter 6 of the GL Specification (State and State Requests) 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci None 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ciAdditions to the GLX / WGL / AGL Specifications 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci None 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ciGLX Protocol 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci Eight rendering commands are sent to the server as part of 1445bd8deadSopenharmony_ci the glXRender request: 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci GlobalAlphaFactorbSUN 1475bd8deadSopenharmony_ci 2 8 rendering command length 1485bd8deadSopenharmony_ci 2 16391 rendering command opcode 1495bd8deadSopenharmony_ci 1 INT8 code 1505bd8deadSopenharmony_ci 1 INT8 pad 1515bd8deadSopenharmony_ci 2 INT16 pad 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci GlobalAlphaFactorsSUN 1545bd8deadSopenharmony_ci 2 8 rendering command length 1555bd8deadSopenharmony_ci 2 16392 rendering command opcode 1565bd8deadSopenharmony_ci 2 INT16 code 1575bd8deadSopenharmony_ci 2 INT16 pad 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci GlobalAlphaFactoriSUN 1605bd8deadSopenharmony_ci 2 8 rendering command length 1615bd8deadSopenharmony_ci 2 16393 rendering command opcode 1625bd8deadSopenharmony_ci 4 INT32 code 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci GlobalAlphaFactorfSUN 1655bd8deadSopenharmony_ci 2 8 rendering command length 1665bd8deadSopenharmony_ci 2 16394 rendering command opcode 1675bd8deadSopenharmony_ci 4 FLOAT32 code 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci GlobalAlphaFactordSUN 1705bd8deadSopenharmony_ci 2 12 rendering command length 1715bd8deadSopenharmony_ci 2 16395 rendering command opcode 1725bd8deadSopenharmony_ci 8 FLOAT64 code 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci GlobalAlphaFactorubSUN 1755bd8deadSopenharmony_ci 2 8 rendering command length 1765bd8deadSopenharmony_ci 2 16396 rendering command opcode 1775bd8deadSopenharmony_ci 1 CARD8 code 1785bd8deadSopenharmony_ci 1 CARD8 pad 1795bd8deadSopenharmony_ci 2 CARD16 pad 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci GlobalAlphaFactorusSUN 1825bd8deadSopenharmony_ci 2 8 rendering command length 1835bd8deadSopenharmony_ci 2 16397 rendering command opcode 1845bd8deadSopenharmony_ci 2 CARD16 code 1855bd8deadSopenharmony_ci 2 CARD16 pad 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci GlobalAlphaFactoruiSUN 1885bd8deadSopenharmony_ci 2 8 rendering command length 1895bd8deadSopenharmony_ci 2 16398 rendering command opcode 1905bd8deadSopenharmony_ci 4 CARD32 code 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ciErrors 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci None 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ciNew State 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci Get Value Get Command Type Initial Value 2015bd8deadSopenharmony_ci --------- ----------- ---- ------------- 2025bd8deadSopenharmony_ci GLOBAL_ALPHA_FACTOR_SUN GetIntegerv, C 1 2035bd8deadSopenharmony_ci GetFloatv 2045bd8deadSopenharmony_ci GLOBAL_ALPHA_SUN IsEnabled B False 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci Get Value Attribute 2075bd8deadSopenharmony_ci --------- --------- 2085bd8deadSopenharmony_ci GLOBAL_ALPHA_FACTOR_SUN color-buffer 2095bd8deadSopenharmony_ci GLOBAL_ALPHA_SUN color-buffer/enable 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ciRevision History 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci 6/25/99 Added fields from the new extension template. 215