• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    SGIX_fog_offset
4
5Name Strings
6
7    GL_SGIX_fog_offset
8
9Version
10
11    $Date: 1999/06/19 00:39:08 $ $Revision: 1.12 $
12
13Number
14
15    65
16
17Dependencies
18
19    OpenGL 1.0 is required.
20    The extension is written against the OpenGL 1.2.1 Specification.
21
22Overview
23
24    This extension allows fragments to look brighter in a foggy
25    environment, by biasing the fragment eye-coordinate distance prior
26    to fog computation. A reference point in eye space (rx ry rz) and an offset
27    amount toward the viewpoint (f_o) are specified. When fog offset is
28    enabled, the offset amount will be subtracted from the fragment
29    distance, making objects appear less foggy.
30
31    If fog computation is done in screen-space coordinates under
32    perspective projection, the reference point is used in adjusting the
33    fog offset to be correct for fragments whose depth is close to that
34    point. The reference point should be redefined when it becomes too
35    far away from the primitives being drawn. Under orthographic
36    projection, or if fog computation is done in eye-space coordinates,
37    the reference point is ignored.
38
39New Procedures and Functions
40
41    None
42
43New Tokens
44
45    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled
46
47	GL_FOG_OFFSET_SGIX		0x8198
48
49    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
50    GetFloatv, and GetDoublev, and by the <pname> parameter of Fogiv and
51    Fogfv:
52
53	GL_FOG_OFFSET_VALUE_SGIX	0x8199
54
55Additions to Chapter 2 of the 1.2.1 Specification (OpenGL Operation)
56
57    None
58
59Additions to Chapter 3 of the 1.2.1 Specification (Rasterization)
60
61  - (3.10, p. 139) Change the second paragraph to:
62
63	"This factor f is computed according to one of three equations:
64
65	    f = exp(-d * f_z),		    (3.24)
66
67	    f = exp(-(d * f_z)^2), or	    (3.25)
68
69		e - f_z
70	    f = -------			    (3.26)
71		e - s
72
73	f_z is a function of the eye-coordinate distance z from the eye,
74	(0,0,0,1) in eye coordinates, to the fragment center. If
75	FOG_OFFSET_SGIX is enabled, then f_z = z - f_o; otherwise, f_z =
76	z. If f_z < 0, then it is clamped to zero prior to fog
77	computation.
78
79	"If fog offset is performed in screen space under perspective
80	projection, the reference point (rx ry rz) is used to adjust f_o
81	appropriately prior to computing f_z. Otherwise, the reference
82	point is unused.
83
84	"The equation, along with the parameters d, e, s, (rx ry rz, and
85	f_o, is specified with..."
86
87
88    Change the end of the third paragraph to:
89
90	"...If <pname> is FOG_DENSITY, FOG_START, or FOG_END, then
91	<param> is or <params> points to a value that is d, s, or e,
92	respectively. If <pname> if FOG_OFFSET_SGIX, then <params>
93	points to four values comprising a 3-valued reference point,
94	(rx ry rz) followed by f_o. If d is specified as less than zero,
95	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, three floating-point values d, e,
101	and s, four floating-point values (rx ry rz f_o), an RGBA fog
102	color and a fog color index, a single bit to indicate whether or
103	not fog is enabled, and a single bit to indicate whether or not
104	fog offset is enabled. In the initial state, fog is disabled,
105	fog offset is disabled, FOG_MODE is EXP, d = 1.0, e = 1.0, s =
106	0.0, and (rx ry rz f_o) = (0,0,0,0); C_f = (0,0,0,0) and i_f =
107	0."
108
109
110Additions to Chapter 4 of the 1.2.1 Specification (Per-Fragment Operations
111and the Framebuffer)
112
113    None
114
115Additions to Chapter 5 of the 1.2.1 Specification (Special Functions)
116
117    None
118
119Additions to Chapter 6 of the 1.2.1 Specification (State and State Requests)
120
121    None
122
123Additions to the GLX Specification
124
125    None
126
127Errors
128
129    None
130
131New State
132
133    (table 6.8, p. 198)
134
135    Get Value		    Type    Get Command     Initial Value   Description			    Sec.    Attribute
136    ---------		    ----    -----------     -------------   -----------			    ----    ---------
137    FOG_OFFSET_SGIX	    B	    IsEnabled	    False	    True if fog offset is enabled   3.10    fog
138    FOG_OFFSET_VALUE_SGIX   4 * R   GetFloatv	    (0, 0, 0, 0)    Fog reference point and offset  3.10    fog
139
140New Implementation Dependent State
141
142    None
143