sinisterchipmunk/jax — Issue #35: Lighting algorithm is mildly inaccurate
Author: sinisterchipmunk
Created: 2011-12-06 15:36:13+00:00
State: open
Labels: bug

The default Jax shaders for lighting include an ambient component for both the light source itself and the material of the mesh being rendered. However, according to the Blinn-Phong shading model which Jax tries to implement by default, the light shouldn't have an ambient component. Instead, the entire scene should have a single ambient component, and each material should have an ambient reflectivity component.

The current model will produce objects that are not evenly lit by a given light's ambient component; worse, the current model applies attenuation factors to the ambient lighting component, resulting in objects which lie far away from any light source not being lit at all.

**Important:** Because objects are rendered in multipass (currently, one render pass per light source in range), it is not adequate to simply add the ambient factor to each render; the result would amplify the ambience in correlation to the number of light sources. The current architecture would instead require an additional, ambient-only pass. Not sure if this is really acceptable due to performance considerations, so this is a less trivial bug to resolve than first glance would imply.