15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci SGIX_fog_offset 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_SGIX_fog_offset 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciVersion 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci $Date: 1999/06/19 00:39:08 $ $Revision: 1.12 $ 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNumber 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci 65 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciDependencies 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci OpenGL 1.0 is required. 205bd8deadSopenharmony_ci The extension is written against the OpenGL 1.2.1 Specification. 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciOverview 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci This extension allows fragments to look brighter in a foggy 255bd8deadSopenharmony_ci environment, by biasing the fragment eye-coordinate distance prior 265bd8deadSopenharmony_ci to fog computation. A reference point in eye space (rx ry rz) and an offset 275bd8deadSopenharmony_ci amount toward the viewpoint (f_o) are specified. When fog offset is 285bd8deadSopenharmony_ci enabled, the offset amount will be subtracted from the fragment 295bd8deadSopenharmony_ci distance, making objects appear less foggy. 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci If fog computation is done in screen-space coordinates under 325bd8deadSopenharmony_ci perspective projection, the reference point is used in adjusting the 335bd8deadSopenharmony_ci fog offset to be correct for fragments whose depth is close to that 345bd8deadSopenharmony_ci point. The reference point should be redefined when it becomes too 355bd8deadSopenharmony_ci far away from the primitives being drawn. Under orthographic 365bd8deadSopenharmony_ci projection, or if fog computation is done in eye-space coordinates, 375bd8deadSopenharmony_ci the reference point is ignored. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciNew Procedures and Functions 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci None 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ciNew Tokens 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci GL_FOG_OFFSET_SGIX 0x8198 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 505bd8deadSopenharmony_ci GetFloatv, and GetDoublev, and by the <pname> parameter of Fogiv and 515bd8deadSopenharmony_ci Fogfv: 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci GL_FOG_OFFSET_VALUE_SGIX 0x8199 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2.1 Specification (OpenGL Operation) 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci None 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2.1 Specification (Rasterization) 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci - (3.10, p. 139) Change the second paragraph to: 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci "This factor f is computed according to one of three equations: 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci f = exp(-d * f_z), (3.24) 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci f = exp(-(d * f_z)^2), or (3.25) 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci e - f_z 705bd8deadSopenharmony_ci f = ------- (3.26) 715bd8deadSopenharmony_ci e - s 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci f_z is a function of the eye-coordinate distance z from the eye, 745bd8deadSopenharmony_ci (0,0,0,1) in eye coordinates, to the fragment center. If 755bd8deadSopenharmony_ci FOG_OFFSET_SGIX is enabled, then f_z = z - f_o; otherwise, f_z = 765bd8deadSopenharmony_ci z. If f_z < 0, then it is clamped to zero prior to fog 775bd8deadSopenharmony_ci computation. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci "If fog offset is performed in screen space under perspective 805bd8deadSopenharmony_ci projection, the reference point (rx ry rz) is used to adjust f_o 815bd8deadSopenharmony_ci appropriately prior to computing f_z. Otherwise, the reference 825bd8deadSopenharmony_ci point is unused. 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci "The equation, along with the parameters d, e, s, (rx ry rz, and 855bd8deadSopenharmony_ci f_o, is specified with..." 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci Change the end of the third paragraph to: 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci "...If <pname> is FOG_DENSITY, FOG_START, or FOG_END, then 915bd8deadSopenharmony_ci <param> is or <params> points to a value that is d, s, or e, 925bd8deadSopenharmony_ci respectively. If <pname> if FOG_OFFSET_SGIX, then <params> 935bd8deadSopenharmony_ci points to four values comprising a 3-valued reference point, 945bd8deadSopenharmony_ci (rx ry rz) followed by f_o. If d is specified as less than zero, 955bd8deadSopenharmony_ci the error INVALID_VALUE is generated." 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci Change the final paragraph on page 140 to: 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci "The state required for fog consists of a three valued integer 1005bd8deadSopenharmony_ci to select the fog equation, three floating-point values d, e, 1015bd8deadSopenharmony_ci and s, four floating-point values (rx ry rz f_o), an RGBA fog 1025bd8deadSopenharmony_ci color and a fog color index, a single bit to indicate whether or 1035bd8deadSopenharmony_ci not fog is enabled, and a single bit to indicate whether or not 1045bd8deadSopenharmony_ci fog offset is enabled. In the initial state, fog is disabled, 1055bd8deadSopenharmony_ci fog offset is disabled, FOG_MODE is EXP, d = 1.0, e = 1.0, s = 1065bd8deadSopenharmony_ci 0.0, and (rx ry rz f_o) = (0,0,0,0); C_f = (0,0,0,0) and i_f = 1075bd8deadSopenharmony_ci 0." 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2.1 Specification (Per-Fragment Operations 1115bd8deadSopenharmony_ciand the Framebuffer) 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci None 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2.1 Specification (Special Functions) 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci None 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2.1 Specification (State and State Requests) 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci None 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ciAdditions to the GLX Specification 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci None 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ciErrors 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci None 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ciNew State 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci (table 6.8, p. 198) 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Sec. Attribute 1365bd8deadSopenharmony_ci --------- ---- ----------- ------------- ----------- ---- --------- 1375bd8deadSopenharmony_ci FOG_OFFSET_SGIX B IsEnabled False True if fog offset is enabled 3.10 fog 1385bd8deadSopenharmony_ci FOG_OFFSET_VALUE_SGIX 4 * R GetFloatv (0, 0, 0, 0) Fog reference point and offset 3.10 fog 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ciNew Implementation Dependent State 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci None 143