Issue Details (XML | Word | Printable)

Key: JAVA3D-552
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: java3d-issues
Reporter: bheffner75
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Add shader bindings to indicate which light slots are enabled

Created: 03/Dec/07 07:17 AM   Updated: 04/Dec/07 04:11 PM
Component/s: j3d-core
Affects Version/s: 1.5.1
Fix Version/s: 1.6.0

Time Tracking:
Not Specified


Operating System: Windows XP
Platform: PC

Issuezilla Id: 552
Participants: bheffner75, java3d-issues and kcr

 Description  « Hide

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
programmable shader.

Java3D dynamically moves light nodes in and out of available light slots
depending upon:

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.

kcr added a comment - 04/Dec/07 04:11 PM

Set target milestone to 1.6.0