Lighting Equation
Previous  Top  Next

In the 3D drawing mode the material properties of objects determine the way the objects interact with the light sources. The color observed at a given point is a resultant of the light source(s) (3D Lighting) and the Material properties; that is, the RGB coefficients of the Ambient, Diffuse and Specular components of the light source(s) are multiplied by the specified colors of the objects, and by the material coefficients in this dialog, then the results are limited to the range 0.0-1.0.

Itotal = Ke C ;emissive
+ Ia Ka C ;ambient
+ Sum(i) [ ( NdotVi ) Ii Kd C ] ;diffuse
+ Sum(i) [ ( NdotSi )^ns Ii Ks ] ;specular

Where

Itotal is the total intensity as an RGB triplet at any point on an object;

Ia is the intensity (RGB triplet) of the ambient light source (3D Lighting dialog);

Ii is the incident intensity (RGB triplet) at the object of directional or positional light source i (3D Lighting dialog);

C is the assigned color (RGB triplet) of the object (Input Atoms, Bonds, Polyhedra dialogs);

Ke is the emissive material coefficient of the object (3D Material Properties dialog);

Ka is the ambient material coefficient of the object (3D Material Properties dialog);

Ks is the specular material coefficient of the object (3D Material Properties dialog);

ns is the specular exponent or shininess coefficient of the object (3D Material Properties dialog);

N (a vector) is the normal to the surface at the point in question;

Vi (a vector) is the direction of the incident directional or positional light i at the point;

S (a vector) is the bisector of the angle between the light-surface vector (or Vi) and the eye-surface vector;

"dot" signifies the vector dot product.

The incident intensity from a light source is itself subject to attenuation (3D Lighting dialog);

Ii = Ii(0) / (Kc + Kl d + Kq d^2 )

Where d is the distance of the point in question from the (positional) light and Kc, Kl and Kq are the constant, linear and quadratic attenuation coefficents respectively. Constant attenuation is essentially a brightness coefficient. Values larger than 1.0 simply darken the scene. Values smaller than 1.0 may add a white component and/or increase the specular contribution. Linear and quadratic attenuation apply only to Positional lights.

Ambient light has no direction or origin and is considered to bathe all objects uniformly. Having a significant ambient component causes non-illuminated parts of objects to be other than black. It thus "softens" the illumination in a somewhat similar way to the Darkest Shade and Darkness Angle parameters (Shading dialog) in the 2D Drawing modes.

Diffuse color is usually the main component of the appearance of objects. The intensity of the color is dependent on the angle between the light ray and the normal to the surface in question.

Specular reflection only occurs when the normal to the surface in question is close to bisecting the angle between the incident light and the vector from the point on the surface to the eye. It produces bright highlights on a curved surface. The larger the Specular material coefficient, the smaller will be the bright specular highlight on a curved surface. The shininess coefficient has a maximum of 128 because of computational restrictions, but values on the order of 5-30 are usually realistic. In ATOMS, specular reflection is always white, that is it does not depend on the color of the object, only the color of the light source(s). For directional lights, specular reflection may not work well for polyhedra because faces at certain angles will give a solid white appearance.

Emission is similar to ambient, except that there is no dependence on the color of any light source. A high value of emission makes an object look like is is glowing.

This equation ignores translucency, which causes colors of objects lying at different depths to be blended.