• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1        INCOMPLETE - DO NOT RELEASE IMPLEMENTATIONS OF THIS EXTENSION
2
3Name
4
5    EXT_fragment_lighting
6
7Name Strings
8
9    GL_EXT_fragment_lighting
10
11Version
12
13    $Date: 1998/09/26 02:49:31 $ $Revision: 1.26 $
14
15Number
16
17    102
18
19Dependencies
20
21    OpenGL 1.1 is required.
22    SGIX_color_range affects the definition of this extension.
23
24Overview
25
26    This extension adds a new lighting stage to the OpenGL pipeline.  This
27    stage occurs during fragment processing after the texture environment
28    has been applied and before fog has been applied.  The extension
29    provides a mechanism for computing 'per-pixel lighting'.  Fragment lighting
30    applies to fragments generated by all primitives including pixel images.
31    This extension doesn't eliminate vertex lighting, but can be used to
32    complement it.  For example, the diffuse contribution can be evaluated
33    at each vertex, and the specular contribution can be evaluated at each
34    fragment with the results being summed together to generate the final
35    result.
36                  Ct  Cf
37                  |   |-------------------------------+
38                  |   |                               |
39                ----------                            |
40                |        |                            |
41                | TexEnv |                            |
42                |        |                            |
43                ----------                            |
44                    |                                 |
45                ----------                            |
46                | Clamp  |            Nf  Lf  Hf  Ff  |
47                ----------            |   |   |   |   | FragmentColorMaterial
48                    |              -----------------  |
49                    |              |               |  v
50                    Cf'            | FragmentLight |<-o-<- Material {Am,Em,Dm,Sm,Nm,...}
51                    |              |               |
52                    |              -----------------
53                    |                      |
54                    |                  ---------
55                    |                  | Clamp |
56                    |                  ---------
57                    |       Cl             |
58                    |      +----------------
59                    v      v
60                  ------------
61                  |          |
62                  | LightEnv |
63                  |          |
64                  ------------
65                       |
66                   ---------
67                   | Clamp |
68                   ---------
69                       |
70                       Cf''
71                       |
72                       v
73                    -------
74                    |     |
75                    | Fog |
76                    |     |
77                    -------
78                       |
79                       v
80
81Patent Note
82
83    To the extent that SGI has patent rights that are unavoidably
84    infringed by all implementations of this extension, SGI will, upon
85    request, grant a license under such patent rights to the requesting
86    party subject to reasonable terms and conditions, and without
87    incremental charge or fee. Such license shall be non-exclusive, and
88    non-transferable, and shall be limited to implementations of the
89    extension in combination with any conformance certified
90    implementation of the OpenGL API. Such license is expressly
91    contingent upon a grant back of a non-exclusive, royalty-free,
92    perpetual, worldwide license to SGI and its OpenGL licensees under
93    the requesting party's patent rights that are unavoidably infringed
94    by all implementations of this extension or OpenGL.
95
96Issues
97
98    *   We specify a complete model and don't allow subsetting.  if
99        portions of the model aren't supported with hardware acceleration
100        then a software implementation of the complete model is
101        necessary.  There should be sufficient mechanism for an
102        implementation to include partial acceleration and easily
103        identify when it can be used.  The alternative is to
104        allow subsetting and a mechanisms for enumerating the capability
105        would this be any better?
106
107        I don't think so.  Lighting will be an important area of
108        growth for OpenGL.  I think we owe it to our developers
109        to force a consistent growth direction by trying to look
110        ahead a little.
111
112    *   We apply texture environment before lighting so that decals
113        can be lighted correctly.  The spec does not provide a
114        mechanism for applying texture after lighting.  There are
115        applications where it would be useful to apply texture after
116        lighting (e.g. shadows or spotlight effects), but we deliberately
117        leave them out.  Instead we will add binding posts in another
118        extension to allow textures to be bound to the attenuation
119        term, specular exponent, environment term, normal perturbation,
120        etc.
121
122    *   Should the FragmentColorMaterial command really be done through
123        texture binding posts and TexEnv moved after lighting?
124
125        No.
126
127    *   New LightModel parameters?
128        yes, NORMAL_INTERPOLATION control
129
130    *   We deliberately chose to decouple the control of normal interpolation
131        for fragment lighting from ShadeModel, choosing to put it in the
132        FragmentLightModel command.  We chose not to provide any mechanism to
133        allow flat coloring before vertex lighting, so FlatShading continues
134        to mean that the vertex color after vertex lighting is used to
135        provide a constant color across the face of a primitive.
136
137    *   Material parameters are not interpolated.  If FragmentMaterial is
138        enabled then the interpolated color parameter will be used as one or
139        more of the material parameters, but there is no equivalent notion
140        to per-vertex materials.  If a material change occurs between a
141        Begin/End sequence, then only the last material specified before the
142        provoking vertex will affect the shading computation.
143
144    *   overload ColorMaterial & Material face param with FRAGMENT_FRONT,
145        FRAGMENT_BACK, and FRAGMENT_FRONT_AND_BACK rather than separate commands?
146
147        since the behaviour is somewhat different (not persistent) so it feels
148        like it should be a different command
149
150    *   proxy mechanism for subsetting?  proxy mechanism for determining
151        what is supported in hardware.  NO.
152
153    *   add some comments about where lighting parameters are sampled
154        (fragment centers, pixel centers, ...)
155
156    *   shadow term is not quite right.  removed it.
157
158    *   should the material be undefined after color material is disabled
159
160        it should be well defined.  fragment color material should be
161        thought of as a switch which causes the material parameters to be
162        sourced from the fragment material 'register' or from the fragment
163        color.  At all times queries to the fragment material refer to the
164        material 'register' and whenever fragment color material is
165        disabled, material parameters are sourced from the unperturbed
166        fragment material 'register'
167
168    *   disallow fragment material changes between begin/end?
169        seems okay, since we added a new command! - DONE
170
171    *   add a total number of lights so that implementations can
172        share state between vertex and fragment lights yet be more flexible
173        about whether the state is used for a vertex or fragment light
174        (vimal).
175
176        Yes.  MAX_ACTIVE_LIGHTS_EXT
177
178    *   is the flatshading definition correct?  unlike flatshading for
179        vertex lighting, the color will not be constant, just the normal
180        so N.L will vary across the face.  Yes, it is what we want.
181        There is now a mechanism which allows flat or smooth color with
182        flat or smooth fragment lighting (flat or smooth normals).
183
184    *   treatment of alpha?
185
186        alpha comes from the diffuse material if fragment lighting
187        is enabled.
188
189    *   the state of FrontFace affects the interpretation of two-sided
190        lighting.  Should there be separate state for vertex and fragment
191        lighting?
192
193        No.  its a property of the geometry and shouldn't different for the
194        two light source types.
195
196New Procedures and Functions
197
198    void FragmentLightModeliEXT(enum pname, int param);
199    void FragmentLightModelfEXT(enum pname, float param);
200    void FragmentLightModelivEXT(enum pname, int *params);
201    void FragmentLightModelfvEXT(enum pname, float *params);
202
203    void FragmentLightiEXT(enum light, enum pname, int param);
204    void FragmentLightfEXT(enum light, enum pname, float param);
205    void FragmentLightivEXT(enum light, enum pname, int *params);
206    void FragmentLightfvEXT(enum light, enum pname, float *params);
207
208    void GetFragmentLightivEXT(enum light, enum pname, int *params);
209    void GetFragmentLightfvEXT(enum light, enum pname, float *params);
210
211    void FragmentMaterialfEXT(enum face, enum pname, const float param);
212    void FragmentMaterialiEXT(enum face, enum pname, const int param);
213    void FragmentMaterialfvEXT(enum face, enum pname, const float *params);
214    void FragmentMaterialivEXT(enum face, enum pname, const int *params);
215
216    void FragmentColorMaterialEXT(enum face, enum mode);
217
218    void GetFragmentMaterialfvEXT(enum face, enum pname, const float *params);
219    void GetFragmentMaterialivEXT(enum face, enum pname, const int *params);
220
221    void LightEnviEXT(enum pname, int param);
222
223
224New Tokens
225
226    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
227    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
228    GetDoublev:
229
230    FRAGMENT_LIGHTING_EXT                               0x8400
231    FRAGMENT_COLOR_MATERIAL_EXT                         0x8401
232
233    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
234    and GetDoublev:
235
236    FRAGMENT_COLOR_MATERIAL_FACE_EXT                    0x8402
237    FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT               0x8403
238    MAX_FRAGMENT_LIGHTS_EXT                             0x8404
239    MAX_ACTIVE_LIGHTS_EXT                               0x8405
240    CURRENT_RASTER_NORMAL_EXT                           0x8406
241
242
243    Accepted by the <pname> parameter of LightEnviEXT, by
244    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
245    GetDoublev:
246
247    LIGHT_ENV_MODE_EXT                                  0x8407
248
249    Accepted by the <pname> parameter of FragmentLightModeliEXT,
250    FragmentLightModelfEXT, FragmentLightModelivEXT,
251    FragmentLightModelfvEXT, GetBooleanv, GetIntegerv, GetFloatv, and
252    GetDoublev:
253
254    FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT               0x8408
255    FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT                   0x8409
256    FRAGMENT_LIGHT_MODEL_AMBIENT_EXT                    0x840A
257    FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT       0x840B
258
259    Accepted by the <light> parameter of FragmentLightfEXT,
260    FragmentLightiEXT, FragmentLightfvEXT, and FragmentLightivEXT, and by
261    the <cap> parameter of Enable, Disable, and IsEnabled, and by the <light>
262    parameter of GetFragmentLightfvEXT and GetFragmentLightivEXT:
263
264    FRAGMENT_LIGHT0_EXT                                 0x840C
265    .
266    .
267    .
268    FRAGMENT_LIGHT7_EXT                                 0x8413
269    <reserve enums for 32>
270
271Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
272
273    Section 2.12 Current Raster Position
274
275    ... <paragraph 2>
276    The current raster position consists of three window coordinates xw, yw,
277    and zw, a clip corrdinate wc value, an eye coordinate distance, a valid
278    bit, and associated data consisting of a color, normal, and texture
279    coordinates. It is set ...
280
281    ... <paragraph 5>
282    The current raster position requires five single-precision floating point
283    values for its xw, yw, and zw window coordinates, its wc clip coordinate,
284    and its eye coordinate distance, a single valid bit, a color (RGBA and color
285    index), normal, and texture coordinates for associated data.  In the initial
286    state, the coordinates and texture coordinates are both (0,0,0,1), the eye
287    coordinate distance is 0, the valid bit is set, the associated RGBA color is
288    (1,1,1,1), the associated color index is 1, and the associated normal is
289    (0,0,1).  In RGBA mode, the associated color index always has its initial
290    value; in color index mode, the RGBA color always maintains its initial
291    value.
292
293    Section 2.13 Colors and Coloring
294
295    ...
296    Next vertex lighting, if enabled produces a color.  If vertex lighting is
297    disabled, the current color is used in further processing. After vertex
298    lighting, RGBA colors are clamped to the range [0,1]. A color index is
299    converted to fixed-point and then its integer portion is masked (see
300    section 2.13.16). After clamping or masking, a primitive may be flatshaded,
301    indicating that all vertices of the primitive are to have the same color
302    (and normal).  Finally, a primitive is clipped, then colors (texture
303    coordinates and normals) must be computed at the vertices introduced or
304    modified by clipping.
305
306Additions to Chapter 3 of the 1.1 Specification (Rasterization)
307
308    Section 3.6.3 Rasterization of Pixel Rectangles
309
310    Conversion to Fragments
311
312    ... <paragraph 2>
313    A fragment arising from a group consisting of color data takes on the color
314    index or color components of the group; the depth, normal and texture
315    coordinates are taken from the current raster position's associated data.
316    A fragment arising from a depth component takes the component's depth
317    value; the color, normal, and texture coordinate are given by those associated
318    with the current raster position.  In both cases texture coordinates s, t,
319    and r are preplaced with s/q, t/q, and r/q, respectively.  If q is less than
320    or equal to zero the results are undefined.  Groups arising from DrawPixels
321    with a <format> of STENCIL_INDEX are treated specially and are described in
322    section 4.3.1.
323
324
325    Before Section 3.9 Fog insert:
326
327    Section 3.9 Fragment Lighting
328
329    If enabled, fragment lighting computes a color for each rasterized fragment
330    by applying an equation defined by a client-specified lighting model to
331    a collection of parameters that can include the fragment coordinates, the
332    coordinates of one or more light sources, the fragment normal, and
333    parameters defining the characteristics of the light source and current
334    fragment material.  Fragment lighting is only defined for RGBA mode, it
335    has no effect in color index mode.
336
337    Fragment lighting may be in one of two states:
338
339    1. Lighting Off.  In this state the color assigned to a fragment is the
340       rasterized fragment's post-texturing color.
341
342    2. Lighting On.  In this state the color assigned to a fragment is the
343       result of combining the rasterized fragment's post-texturing color and
344       a color computed from the current fragment lighting parameters.  The
345       two colors are combined according to the function defined
346       by Lighting Environment described below.
347
348    Fragment lighting is turned either on or off using the generic Enable or
349    Disable commands with the symbolic value FRAGMENT_LIGHTING_EXT.
350
351    3.9.1 Lighting Environment
352
353    The command
354
355    void LightEnviEXT(enum pname, int param);
356
357    sets parameters of the lighting environment that specifies how the computed
358    illumination value is combined with the post-texturing fragment color.
359    <pname> is a symbolic constant indicating the parameter to be set, <param>
360    is a value to which to set a single valued parameter.  The possible
361    environment parameter is LIGHT_ENV_MODE_EXT. LIGHT_ENV_MODE_EXT may be
362    set to one of REPLACE, MODULATE, or ADD.
363
364    The value of LIGHT_ENV_MODE_EXT specifies an environment function.
365    The result of this function depends on the post-texturing fragment color
366    (Cf) and the color computed (Cl) in equation (3.2) below. The functions
367    are specified in Table 3.3
368
369    REPLACE     MODULATE        ADD
370
371    Rv = Rl     Rv = RfRl       Rv = Rf+Rl
372    Gv = Gl     Gv = GfGl       Gv = Gf+Gl
373    Bv = Bl     Bv = BfBl       Bv = Bf+Bl
374    Av = Al     Av = AfAl       Av = Af+Al
375
376    Table 3.3 Light environment functions
377
378
379    3.9.2 Lighting Operation
380
381    The equation for the fragment illumination model is:
382
383    C  =  Em                            emissive
384       + Am*As                          ambient material*scene ambient color
385       SUM{_i = 0 through Nf-1} {
386       + Atten_i*SpotL_i*{              distance/spot light attenuation
387            + Am*Al_i                   ambient material*ambient light
388            + Dm*Dl_i*(N.L_i)           diffuse material*diffuse light
389            + Sm*Sl_i*(f_i)(N.H_i)^n    specular material*specular light
390          }
391        }
392
393        Nf is the number of fragment light sources
394        N is the fragment normal vector
395        L_i is the direction vector from the fragment position to the light source
396        H_i is the half angle vector
397        f_i is as defined in equation (2.2)
398        n is the specular exponent (shininess)
399
400    Rewrite the equation as:
401
402    I[i] = Atten_i*SpotL_i*(Am*Al_i + Dm*Dl_i*(N.L_i) + Sm*Sl*(f_i)(N.H_i)^n) (3.1)
403
404    and
405
406    I' = SUM{i = 0 through Nf-1} I[i]
407
408    C = Em + Am*As + I'                                         (3.2)
409
410    Equation (3.1) is the same as the vertex lighting equation described in
411    section 2.13.1 for a single light source. Similar to vertex lighting,
412    equation 3.2 is only evaluated for the R, G, and B components and the A
413    component of C is determined from the alpha component of Dm.
414
415    In order to compute the illumination terms for each fragment, the eye
416    coordinates of the fragment can be used to compute the light direction,
417    half angle vector, and attenuation factor in a manner similar to that
418    used in the vertex lighting computations.  It is permissible for an
419    implementation to approximate these by computing these values as well
420    as the normal vector at the vertices and interpolating and
421    renormalizing the results.
422
423    Fragment material state is maintained which is distinct from the
424    vertex material state.  The fragment material state consists of
425    emission, ambient, diffuse, specular and shininess terms for both
426    the front and back face of a primitive.  Unlike vertex lighting, the
427    fragment material state is constant across a primitive since
428    it is resolved during rasterization.  The results of the back face
429    computation described in section 3.5.1 are used to determine whether
430    the front material or back material is used when two sided lighting
431    is enabled.
432
433    There is separate state for each fragment light source.  The
434    fragment light source parameters are the same as the vertex light
435    source parameters described in section 2.13.1.  The minimum number of
436    fragment light sources is 1.  The number of available fragment light
437    sources can be queried by issuing the Get command with the <pname>
438    parameter set to MAX_FRAGMENT_LIGHTS_EXT.
439
440    Distinct lighting model state is also maintained for vertex lighting and
441    fragment lighting.  The lighting model state is described in section
442    2.13.1.  Fragment lighting model state includes one additional parameter,
443    FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT, which controls how normals
444    are selected for use in the fragment lighting computations for a primitive.
445    If FLAT is selected for the lighting model, the normal from the provoking
446    vertex (as described in Section 2.13.7 Flatshading) of the primitive for all
447    fragment lighting computations for the primitive.  If SMOOTH is specified
448    a normal is computed for each fragment using the normals from all of the
449    vertices of the primitive.
450
451    Fragment lighting differs from vertex lighting in that all components
452    of lighting parameters which are of type color in Table 2.7 are clamped
453    to the range [0,1] when they are specified.
454
455    Equation 3.1 is evaluated for each light source and the resulting
456    colors are summed. This result is added to the material emissive and
457    scene ambient terms as in equation 3.2 to produce the R, G, and B
458    color components.   The A component is determined from the diffuse
459    material's A component.  The resulting color components
460    are clamped to the range [0,1] and then passed to the lighting
461    environment computation.
462
463
464    3.9.3 Lighting Parameter Specification
465
466    The fragment material state can be set with the commands
467    FragmentMaterialfEXT, FragmentMaterialfvEXT, FragmentMaterialiEXT,
468    FragmentMaterialivEXT using the values AMBIENT, DIFFUSE, SPECULAR,
469    SHININESS and EMISSION.  This state can be queried using the commands
470    GetFragmentMaterialfvEXT and GetFragmentMaterialivEXT.
471
472    Lighting parameters for fragment light i can be modified by issuing the
473    commands FragmentLightfEXT, FragmentLightiEXT, FragmentLightfvEXT, and
474    FragmentLightivEXT with the <light> parameter
475    set to FRAGMENT_LIGHTi_EXT.  The lighting parameters for fragment light i
476    can be queried by issuing the commands GetFragmentLightfvEXT and
477    GetFragmentLightivEXT with the <light> parameter set to FRAGMENT_LIGHTi_EXT.
478
479    Lighting model parameters for fragment lighting can be modified using the
480    commands FragmentLightModel{T}EXT, FragmentLightModel{T}vEXT.  The
481    lighting model parameters can be queried by issuing the Get command <pname>
482    parameter set to the appropriate fragment lighting model parameter:
483    FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT, FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT,
484    FRAGMENT_LIGHT_MODEL_AMBIENT_EXT or FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT.
485
486
487    3.9.4 FragmentColorMaterial
488
489    One or more fragment material properties in Equation 3.2 can be
490    replaced with the fragment's pre-texturing color, causing these color
491    values to be used during the lighting computation.  This behavior is enabled
492    and disabled  by calling Enable and Disable with the symbolic value
493    FRAGMENT_COLOR_MATERIAL.
494
495    The command that controls which of these modes is selected is
496
497        void FragmentColorMaterial(enum face, enum mode);
498
499    <face> is one of FRONT, BACK, or FRONT_AND_BACK, indicating whether
500    the front material, back material, or both are affected by the
501    pre-texturing color.  <mode> is one of EMISSION, AMBIENT, DIFFUSE,
502    SPECULAR, or AMBIENT_AND_DIFFUSE and specifies which material property
503    or properties are subsituted with the pre-texturing color.  The substutions
504    do not affect the material state.  When FragmentColorMaterial
505    is disabled the values in the fragment material state are used.
506    GetFragmentMaterial returns the fragment material last specified with
507    FragmentMaterial, regardless of whether FragmentColorMaterial is enabled.
508
509    3.9.5 Interactions with Vertex Lighting
510
511    In order to allow implementions to share resources for vertex lighting and
512    fragment lighting, an implementation may limit the maximum number of combined
513    vertex and fragment lights to a number less than the sum of MAX_LIGHTS and
514    MAX_FRAGMENT_LIGHTS_EXT.  This limit can be queried using the Get command
515    with <pname> parameter MAX_ACTIVE_LIGHTS_EXT.  State for all
516    fragment and vertex lights is always maintained.  When multiple
517    lights are enabled, priority is given to vertex lights starting with
518    LIGHT0 through LIGHT<n> where <n> is equal to MAX_LIGHTS, followed by
519    FRAGMENT_LIGHT0_EXT through FRAGMENT_LIGHT<m>_EXT where <m> is equal
520    to MAX_FRAGMENT_LIGHTS_EXT.
521
522
523Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
524and the Frame Buffer)
525
526    None
527
528Additions to Chapter 5 of the 1.1 Specification (Special Functions)
529
530    None
531
532Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
533
534    TBD
535
536Additions to the GLX Specification
537
538    TBD
539
540Dependencies on SGIX_color_range
541
542    If SGIX_color_range is implemented, then the components of lighting
543    parameters of type color, the result of evaluating the lighting
544    equation and the results of evaluating the lighting environment
545    are clamped to the extended color range rather than [0,1].
546
547Errors
548    INVALID_ENUM is generated if FragmentMaterial{T}EXT,
549    FragmentMaterial{T}vEXT, or FragmentColorMaterialEXT, parameter <face> is
550    not FRONT, BACK or FRONT_AND_BACK.
551
552    INVALID_ENUM is generated if FragmentMaterial{T}EXT or
553    FragmentMaterial{T}vEXT parameter <pname> is not AMBIENT, DIFFUSE,
554    SPECULAR, EMISSION, SHININESS, or AMBIENT_AND_DIFFUSE.
555
556    INVALID_ENUM is generated if GetFragmentMaterial{T}vEXT parameter <face>
557    is not FRONT or BACK.
558
559    INVALID_ENUM is generated if GetFragmentMaterial{T}vEXT parameter <pname>
560    is not AMBIENT, DIFFUSE, SPECULAR, EMISSION, or SHININESS,
561
562    INVALID_ENUM if FragmentColorMaterialEXT parameter <mode> is not EMISSION,
563    AMBIENT, DIFFUSE, SPECULAR, or AMBIENT_AND_DIFFUSE
564
565    INVALID_ENUM if LightEnviEXT parameter <pname> is not LIGHT_ENV_MODE_EXT
566    or if parameter <mode> is not REPLACE, MODULATE, or ADD.
567
568    INVALID_ENUM is generated if FragmentLightModel{T}EXT <pname> is not
569    FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT, FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT
570    or FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT or if
571    FragmentLightModel{T}vEXT, parameter <pname> is not
572    FRAGMENT_LIGHT_MODEL_AMBIENT_EXT, FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT
573    FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT or
574    FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT.
575
576    INVALID_ENUM is generated if FragmentLight{T}EXT, FragmentLight{T}vEXT,
577    or GetFragmentLight{T}vEXT parameter <light> is not FRAGMENT_LIGHT0_EXT
578    ... FRAGMENT_LIGHT<n>_EXT where n is one minus the number of supported
579    fragment lights, or if FragmentLight{T}EXT parameter <pname> is not
580    SPOT_EXPONENT, SPOT_CUTOFF, CONSTANT_ATTENUATION, LINEAR_ATTENUATION, or
581    QUADRATIC_ATTENUATION, or if FragmentLight{T}vEXT or
582    GetFragmentLight{T}vEXT parameter <pname> is not AMBIENT, DIFFUSE,
583    SPECULAR, POSITION, SPOT_DIRECTION, SPOT_EXPONENT, SPOT_CUTOFF,
584    CONSTANT_ATTENUATION, LINEAR_ATTENUATION, or QUADRATIC_ATTENUATION.
585
586    INVALID_VALUE is generated if FragmentLight{T}EXT or FragmentLight{T}vEXT
587    parameter <param> if a spot exponent value is specified outside the range
588    [0,128], or if spot cutoff is specified outside the range [0,90] (except
589    for the special value 180), or if a negative attenuation factor is
590    specified.
591
592    INVALID_OPERATION is generated if FragmentMaterial{T}EXT,
593    FragmentMaterial{T}vEXT, FragmentColorMaterialEXT,
594    GetFragmentMaterial{T}vEXT, LightEnviEXT, FragmentLight{T}EXT,
595    FragmentLight{T}vEXT, FragmentLightModel{T}EXT,
596    FragmentLightModel{T}vEXT or GetFragmentLight{T}vEXT is executed between
597    execution of Begin and the corresponding execution of End.
598
599New State
600
601    Get Value                                   Get Command                     Type    Initial Value           Attribute
602    ---------                                   -----------                     ----    -------------           ---------
603
604    FRAGMENT_LIGHTING_EXT                       IsEnabled                       B       False                   lighting/enable
605    FRAGMENT_COLOR_MATERIAL_EXT                 IsEnabled                       B       False                   lighting/enable
606    FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT       GetIntegerv                     Z5      AMBIENT_AND_DIFFUSE     lighting
607    FRAGMENT_COLOR_MATERIAL_FACE_EXT            GetIntegerv                     Z3      FRONT_AND_BACK          lighting
608    AMBIENT                                     GetFragmentMaterialfvEXT        2xC     (0.2,0.2,0.2,1.0)       lighting
609    DIFFUSE                                     GetFragmentMaterialfvEXT        2xC     (0.8,0.8,0.8,1.0)       lighting
610    SPECULAR                                    GetFragmentMaterialfvEXT        2xC     (0.0,0.0,0.0,1.0)       lighting
611    EMISSION                                    GetFragmentMaterialfvEXT        2xC     (0.0,0.0,0.0,1.0)       lighting
612    SHININESS                                   GetFragmentMaterialfvEXT        2xR     0.0                     lighting
613    FRAGMENT_LIGHT_MODEL_AMBIENT_EXT            GetFloatv                       C       (0.2,0.2,0.2,0.2)       lighting
614    FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT       GetBooleanv                     B       False                   lighting
615    FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT           GetBooleanv                     B       False                   lighting
616    FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT       GetIntegerv             Z2      SMOOTH                  lighting
617    AMBIENT                                     GetFragmentLightfvEXT           1*xC    (0.0,0.0,0.0,1.0)       lighting
618    DIFFUSE                                     GetFragmentLightfvEXT           1*xC    see 3.x                 lighting
619    SPECULAR                                    GetFragmentLightfvEXT           1*xC    see 3.x                 lighting
620    POSITION                                    GetFragmentLightfvEXT           1*xP    (0.0,0.0,1.0,0.0)       lighting
621    CONSTANT_ATTENUATION                        GetFragmentLightfvEXT           1*xR    1.0                     lighting
622    LINEAR_ATTENUATION                          GetFragmentLightfvEXT           1*xR+   0.0                     lighting
623    QUADRATIC_ATTENUATION                       GetFragmentLightfvEXT           1*xR+   0.0                     lighting
624    SPOT_DIRECTION                              GetFragmentLightfvEXT           1*xD    (0.0,0.0,-1.0)          lighting
625    SPOT_EXPONENT                               GetFragmentLightfvEXT           1*xR+   0.0                     lighting
626    SPOT_CUTOFF                                 GetFragmentLightfvEXT           1*xR+   180.0                   lighting
627    FRAGMENT_LIGHTi_EXT                         IsEnabled                       1*xB    False                   lighting/enable
628    LIGHT_ENV_MODE_EXT                          GetIntegerv                     Z3      REPLACE                 lighting
629
630    CURRENT_RASTER_NORMAL_EXT                   GetFloatv                       N       (0,0,1)                 current
631
632New Implementation Dependent State
633
634    Get Value                           Get Command                     Type    Minimum Value
635    ---------                           -----------                     ----    -------------
636    MAX_FRAGMENT_LIGHTS_EXT             GetIntegerv                     Z+      1
637    MAX_ACTIVE_LIGHTS_EXT               GetIntegerv                     z+      MAX_LIGHTS
638