1
'''OpenGL extension APPLE.specular_vector
3
This module customises the behaviour of the
4
OpenGL.raw.GL.APPLE.specular_vector to provide a more
7
Overview (from the spec)
9
An alternative specular lighting model is enabled by passing
10
the LIGHT_MODEL_SPECULAR_VECTOR token as the <pname> parameter
11
to LightModel, and TRUE as the <param> parameter. The specular
12
vector lighting model calculates the specular intensity as the
13
dot product of the true reflection vector of the light source
14
and the vector from the vertex to the viewpoint. This yields
15
results that are visually similar to but often more realistic
16
than the existing lighting model.
18
Mathematically, the specular component s.n in the existing
19
lighting model calculation is replaced with the following
20
alternative calculation.
22
Given three vectors, n, l, and p, where n is the unit normal
23
vector at the vertex, l is the unit vector from the vertex to
24
the light position, and p is the unit vector from the vertex
25
to the viewpoint (or the vector {0,0,1} if
26
LIGHT_MODEL_LOCAL_VIEWER is false), the specular component is
29
(2 * cross(n, cross(n, l)) + l) . p
31
All other lighting model and material parameters (shininess,
32
spotlight, attenuation, local viewer, and direction/positional
33
sources) operate normally. The specular vector lighting model
34
affects both rgba and index modes.
36
The official definition of this extension is available here:
37
http://www.opengl.org/registry/specs/APPLE/specular_vector.txt
39
from OpenGL import platform, constants, constant, arrays
40
from OpenGL import extensions, wrapper
41
from OpenGL.GL import glget
43
from OpenGL.raw.GL.APPLE.specular_vector import *
44
### END AUTOGENERATED SECTION
45
from OpenGL.GL import glget
46
glget.addGLGetConstant( GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE, (1,) ) # check size...
b'\\ No newline at end of file'