1Name 2 3 SGIX_fog_scale 4 5Name Strings 6 7 GL_SGIX_fog_scale 8 9Version 10 11 $Date: 1999/04/02 22:52:37 $ $Revision: 1.6 $ 12 13Number 14 15 161 16 17Dependencies 18 19 OpenGL 1.0 is required. 20 The extension is written against the OpenGL 1.2.1 Specification. 21 SGIX_fog_offset affects the definition of this extension 22 23Overview 24 25 This extension allows fragments to receive more or less fog than the 26 amount specified by the fog environment and the distance to the 27 fragment center, by scaling the fragment eye-coordinate distance 28 prior to fog computation. 29 30 This is particularly interesting for light point objects that punch 31 even through thick fog. Fog scale value is specified by setting the 32 FOG_SCALE_VALUE_SGIX scale parameter with glFog*. If scale <= 0, the 33 resulting operation is clamped to 0. If 0 < scale < 1, the object 34 appears brighter. If scale > 1, the object receives more fog. A 35 scale of 1 has no effect. Fog scale can be enabled or disabled with 36 the FOG_SCALE_SGIX parameter. 37 38Issues 39 40 * Should specifying FOG_SCALE_VALUE_SGIX < 0 generate an error? 41 42 * Should the correct combined equation be (z * scale) - offset, or 43 (z - offset) * scale? Performer uses the latter, but the former is 44 more consistent with other OpenGL scale and bias operations. 45 46 47New Procedures and Functions 48 49 None 50 51New Tokens 52 53 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled 54 55 FOG_SCALE_SGIX 0x81FC 56 57 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 58 GetFloatv, and GetDoublev, and by the <pname> parameter of Fogiv and 59 Fogfv: 60 61 FOG_SCALE_VALUE_SGIX 0x81FD 62 63Additions to Chapter 2 of the 1.2.1 Specification (OpenGL Operation) 64 65 None 66 67Additions to Chapter 3 of the 1.2.1 Specification (Rasterization) 68 69 - (3.10, p. 139) Change the second paragraph to: 70 71 "This factor f is computed according to one of three equations: 72 73 f = exp(-d * f_z), (3.24) 74 75 f = exp(-(d * f_z)^2), or (3.25) 76 77 e - f_z 78 f = ------- (3.26) 79 e - s 80 81 f_z is a function of the eye-coordinate distance z from the eye, 82 (0,0,0,1) in eye coordinates, to the fragment center. If 83 FOG_SCALE_SGIX is enabled, then f_z = z * f_s; otherwise, f_z = 84 z. If f_z < 0, then it is clamped to zero prior to fog 85 computation. 86 87 "The equation, along with the parameters d, e, s, and f_s, is 88 specified with..." 89 90 Change the end of the third paragraph to: 91 92 "...If <pname> is FOG_DENSITY, FOG_START, FOG_END, or 93 FOG_SCALE_SGIX, then <param> is or <params> points to a value 94 that is d, s, e, or f_s, respectively. If d is specified as less 95 than zero, the error INVALID_VALUE is generated." 96 97 Change the final paragraph on page 140 to: 98 99 "The state required for fog consists of a three valued integer 100 to select the fog equation, four floating-point values d, e, s, 101 and f_s, an RGBA fog color and a fog color index, a single bit 102 to indicate whether or not fog is enabled, and a single bit to 103 indicate whether or not fog scaling is enabled. In the initial 104 state, fog is disabled, fog scaling is disabled, FOG_MODE is 105 EXP, d = 1.0, e = 1.0, s = 0.0, and f_s = 1.0; C_f = (0,0,0,0) 106 and i_f = 0." 107 108Additions to Chapter 4 of the 1.2.1 Specification (Per-Fragment Operations 109and the Framebuffer) 110 111 None 112 113Additions to Chapter 5 of the 1.2.1 Specification (Special Functions) 114 115 None 116 117Additions to Chapter 6 of the 1.2.1 Specification (State and State Requests) 118 119 None 120 121Additions to the GLX Specification 122 123 None 124 125Dependencies on SGIX_fog_offset 126 127 If SGIX_fog_offset is supported, then both scale and offset can be 128 applied to z prior to fog computation. Combining the new language of 129 the two specifications is straightforward except at the end of the 130 second paragraph of section 3.10, which should read: 131 132 "...f_z is a function of the eye-coordinate distance z from the 133 eye, (0,0,0,1) in eye coordinates, to the fragment center. If 134 both FOG_OFFSET_SGIX and FOG_SCALE_SGIX are enabled, then f_z = 135 z * f_s - f_o. If only FOG_OFFSET_SGIX is enabled, then f_z = z 136 - f_o. If only FOG_SCALE_SGIX is enabled, then f_z = z * f_s. 137 Otherwise, f_z = z. If f_z < 0, then it is clamped to zero prior 138 to fog computation." 139 140Errors 141 142 None 143 144New State 145 146 (table 6.8, p. 198) 147 148 Get Value Type Get Command Initial Value Description Sec. Attribute 149 --------- ---- ----------- ------------- ----------- ---- --------- 150 FOG_SCALE_SGIX B IsEnabled False True if fog scaling is enabled 3.10 fog 151 FOG_SCALE_VALUE_SGIX R GetFloatv 1.0 Fog scaling factor 3.10 fog 152 153New Implementation Dependent State 154 155 None 156