Let there be light


Lighting model used in dojox.gfx3d is merged from Eugene’ s 2D lighting utility library. We take a simplified Phong reflection model to gear towards the vector graphics:

  • All light sources are infinitely far away
  • No shadow support
  • Second-order reflections is not accounted

Cylinders in sunshine

The reflection from a surface is divided into three subcomponents, specular reflection, diffuse reflection, and ambient reflection. Due to the effect of parallel light, a polygon surface is ubiquitously the same since the angle between the light and the normal vector is the same. The curved surface in Cylinder can be imitated by the linear gradient. Here is an example how the cylinder looks like in the sunshine.

Here is the snapshot of development. They look real, but we still need more calculation to verify whether the lighting model is precise or not.