GLSL provides access to some of the native OpenGL state information. Some of
this information appertains to light sources and corresponding parameters.
Unfortunately, state information about whether a light source is enabled is not
provided (which baffles me). This means that the calls glEnable() and
glDisable() do not set any state information that can be accessed by a GLSL
Java3D dynamically moves light nodes in and out of available light slots
1. API calls to setEnable()
2. attachment to a scene graph
3. intersection of the camera with light influencing bounds.
The consequences of this management system are:
1. It is not guaranteed that a light source will be allocated to the same
light slot across multiple rendering requests.
2. Automatic disabling of a light source due to the camera not intersecting
its influencing bounds does cannot be detected by a shader program. No
information is passed into the shader that can be used to act upon this activity.
Propose an enhancement to provide shader bindings that indicate which light
slots are currently enabled. This state information ought to reflect both
application developer and internal system management actions.
A recommended approach might be to pass in something like:
uniform bool lightSourceEnabled[gl_MaxLights]
Where each index in the array corresponds to GL_LIGHT0 + index. The application
developer could then access the array using a ShaderAttributeBinding.