• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    SGIS_fog_function
4
5Name Strings
6
7    GL_SGIS_fog_function
8
9Version
10
11    Last Modified Date: March 30, 1999
12    Author Revision: $Header: //depot/main/doc/registry/extensions/SGI/fog_func.spec#13 $
13
14Number
15
16    64
17
18Dependencies
19
20    OpenGL 1.1 is required. Written against the OpenGL 1.2 Specification.
21
22Overview
23
24    This extension allows to define application-specific fog blend-factor
25    function.  Function is defined by the set of the "control" points and
26    should be monotonic. Each control point represented as a pair of the
27    eye-space distance value and corresponding value of the fog blending
28    factor. The minimum number of control points is one. The maximum
29    number is implementation dependent.
30
31
32New Procedures and Functions
33
34    void FogFuncSGIS(sizei n, const float* points);
35
36    void GetFogFuncSGIS(float *points);
37
38Issues
39
40   - The Bali team introduced 2 new features in this spec. 1) the
41   GetFogFuncSGIS procedure that allows to querry automatically
42   the current number of contol points. It is much nicer than
43   the previous spec that was using gets. 2) If the user give
44   fog blending factor ouside the [0.0, 1.0] range it should not
45   generate an error but the valuse should be calmed instead.
46
47   However, this extension has already been shipped and it is a
48   problem. We would like to see this extension to be an EXT to
49   be able to do the right thing.
50
51   - If the above changes are not acceptable, the sentence "All the points
52   of the current fog factor function are queried by calling
53   GetFogFuncSGIS." in section "Additions to Chapter 6 of the 1.2
54   Specification (State and State Requests)" should be replaced by:
55   "All the points of the current fog factor function are queried by
56   calling GetFloatv or GetDoublev with <pname> set to FOG_FUNC_SGIS."
57   Also, the sentence "INVALID_OPERATION is generated if GetFogFuncSGIS
58   is executed between execution of Begin and the corresponding
59   execution to End. " in the "Errors" section should be ignored.
60
61   The sentences "The first value of each value pair in <points>
62   specifies a value of eye-space distance (should be not negative),
63   and the second value of each value pair specifies the corresponding
64   value of the fog blend factor. The fog blend factor values are
65   clamped to [0.0, 1.0]." should be replced by "The first
66   value of each value pair in <points> specifies a value of eye-space
67   distance (should be not negative), and the second value of each value pair
68   specifies the corresponding value of the fog blend factor (should be in
69   [0.0, 1.0] range)." Also "INVALID_VALUE is generated if fog factor
70   value out of [0.0, 1.0] range." should be added to the error section.
71
72
73New Tokens
74
75    Accepted by the <param> parameter of Fogf and Fogi, and by the <params>
76    parameter of Fogiv and Fogfv, when their <pname> parameter is FOG_MODE,
77    and by the <pname> parameter of GetDoublev and GetFloatv:
78
79        FOG_FUNC_SGIS                           = 0x812A
80
81    Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
82    GetIntegerv, and GetFloatv:
83
84        FOG_FUNC_POINTS_SGIS                    = 0x812B
85        MAX_FOG_FUNC_POINTS_SGIS                = 0x812C
86
87    May be returned by GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv
88    when their <pname> parameter is FOG_MODE:
89
90        FOG_FUNC_SGIS                           = 0x812A
91
92
93Additions to Chapter 2 of the 1.2 Specification (OpenGL Operation)
94
95    None
96
97Additions to Chapter 3 of the 1.2 Specification (Rasterization)
98
99
100    3.10 Fog
101
102    The function for computing blending factor may be specified by calling
103    FogFuncSGIS with <points> pointing at an array of pairs of floating point
104    values, and <n> set to the number of value pairs in <points>. The first
105    value of each value pair in <points> specifies a value of eye-space
106    distance (should be not negative), and the second value of each value pair
107    specifies the corresponding value of the fog blend factor. The fog
108    blend factor values are clamped to [0.0, 1.0]. The order in which
109    the points are specified is significant (if there is more then one
110    point) based on the following requirements: 1. distance value of
111    each point is not smaller then the distance value of its
112    predecessor; 2. fog factor value of each point is not bigger then
113    the fog factor value of its predecessor. The <n> value
114    pairs in <points> completely specify the function, replacing any previous
115    specification that may have existed. At least one control point should be
116    specified. The maximum number of control points is implementation dependent
117    and may be inquired by Get commands. Initially fog function defined by a
118    single point (0.0, 1.0).
119
120    Fog factor function is evaluated by fitting a curve through the points
121    specified by FogFuncSGIS. This curve may be linear between adjacent points,
122    or it may be smoothed, but it will pass exactly through the points, limited
123    only by the resolution of the implementation. The value pair with the
124    lowest distance value specifies the fog function value for all values of
125    distance less than or equal to that pair's distance. Likewise, the value
126    pair with the greatest distance value specifies the function value for
127    all values of distance greater than or equal to that pair's distance.
128
129    If <pname> is FOG_MODE, and <param> is, or <params> point to an
130    integer FOG_FUNC_SGIS then application specified fog factor function is
131    selected for the fog calculation.
132
133Additions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations
134and the Framebuffer)
135
136    None
137
138Additions to Chapter 5 of the 1.2 Specification (Special Functions)
139
140    None
141
142Additions to Chapter 6 of the 1.2 Specification (State and State Requests)
143
144    The max allowed number of points in the fog factor function specification
145    of a fog is queried by calling GetBooleanv, GetIntegerv, GetFloatv,
146    and GetDoublev with <pname> set to MAX_FOG_FUNC_POINTS_SGIS.
147    The number of points in the current fog factor function is queried by
148    calling GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev with <pname>
149    set to FOG_FUNC_POINTS_SGIS. All the points of the current fog
150    factor function are queried by calling GetFogFuncSGIS. Points are
151    returned  in the same format as they are specified in the
152    glFogFuncSGIS  function.
153
154Additions to the GLX Specification
155
156    None
157
158Errors
159
160    INVALID_VALUE is generated if FogFuncSGIS parameter <n> is
161    negative.
162
163    INVALID_VALUE is generated if eye spce-distance is less then zero.
164
165    INVALID_VALUE is generated if specified control points don't confirm
166    with order requirements.
167
168    INVALID_OPERATION is generated if FogFuncSGIS is executed between
169    execution of Begin and the corresponding execution to End.
170
171    INVALID_OPERATION is generated if GetFogFuncSGIS is executed
172    between execution of Begin and the corresponding execution to
173    End.
174
175New State
176
177    Get Value			Get Command		Type		Initial Value	Attribute
178    ---------			-----------		----		-------------	---------
179    MAX_FOG_FUNC_POINTS_SGIS	GetIntegerv		Z+		XXX
180    FOG_FUNC_POINTS_SGIS	GetIntegerv		Z+		1		fog
181    FOG_FUNC_SGIS		GetFloatv		2 x n x R+	(0.0, 1.0)
182
183New Implementation Dependent State
184
185    None
186