Crystal Impact Home  
  About version 5 New functions Feature tour Download  

Diamond Version 5 User Manual: Display of structure picture

Lighting

Previous article: Background
Next article: Other effects


Diamond uses lighting effects for both flat and rendered representation, but in a quite different way. Although for both methods parallel light is used with a directional vector defining the position of the light source, the shape is quite different.

"Lighting Effects for Flat Representation" describes what parameters are used for flat representation.

"Lighting Effects for Rendered Representation" describes how to handle lighting for rendered representation.

To enable or disable lighting, push the Picture Settings  button in the Picture toolbar Picture Settings toolbar button, which opens a menu where you choose the Lighting command. (The symbol left beneath the command is marked yellow, if lighting is enabled.)

Picture Settings menu opened from Picture toolbar with Lighting command highlighted

Or choose the Picture Settings command from the Display menu, and then change to the Lighting page of the Picture Settings dialog, where you set or clear the checkmark at Enable lighting.

 


Lighting Effects for Flat Representation

If Diamond uses flat representation, the following settings are used for lighting:

ˇ       Position of the light source, defined by a directional vector in view coordinates (e.g. the vector (0,0,1) defines light coming from the positive end of the z-axis of the view coordinate system, that means from the viewer's position).

ˇ       A relative intensity (0 through 1) of the light.

To edit the lighting settings for flat representation, choose the Picture Settings command from the Display menu, and then change to the Lighting page of the Picture Settings dialog.

Switching light source on or off

Check the checkbox Enable lighting to enable lighting. Otherwise no lighting will be used and the controls on the Lighting page of the Picture Settings dialog are not available.

Intensity of light

Define the intensity of the light with the input field Standard intensity.

With a value of 0, no lighting is used, whereas 1 leads to maximum intensity. Diamond's lighting value is an empiric value:

a) Atoms get a lighting bulb if the intensity lies between 0 and 0.5 with a color interpolated between the atom's main color (0.0) and white (0.5). For values higher than 0.5 the bulb is white too. Note: Thermal ellipsoids will never be lighted.

b) A polyhedron face appears white if the intensity is 1.0 and the light falls on it orthogonally. Faces on the opposite side of the light source appear black. For lower intensities and non-orthogonal light falls, the color is interpolated between the faces' main color and white or black, rsp.

Position of light source

The three input fields Light source vector;... define the x-, y-, and z-component of the directional vector of the light source in view coordinates. This vector points from the center of rotation towards the light source, which is infinitely far away. If the vector is set to (-1, 1, 1) e.g., the light comes from the upper left front.

The other controls on the Lighting page will be used for rendered representation only. That means you can neither define different light components nor a color composition. The light for flat representation is white in any case.

 


Lighting Effects for Rendered Representation

If Diamond uses rendered representation, lighting effects depend on two different groups of settings:

(1) Global settings (the light source itself):

ˇ       Position of the light source, defined by a directional vector in view coordinates (e.g. the vector (0,0,1) defines light coming from the positive end of the z-axis of the view coordinate system, that means from the viewer's position).

ˇ       The ambient, specular, and diffuse components, each composed by a red, green, and blue part.

(2) Individual settings (material properties of the objects):

ˇ       For each atom, bond, and polyhedron face, the red, green, and blue components of a specular and emissive reflectivity are defined individually.

ˇ       The "shininess".

ˇ       The transparency.

The individual settings will be described for the atoms, bonds, and polyhedra, rsp.:
- "Designing atoms",
- "Designing bonds and contacts",
- "Polyhedron design and hatching".

To edit the global light settings for rendered representation, choose the Picture Settings command from the Display menu, and then change to the Lighting page of the Picture Settings dialog.

Switching light source on or off

Check the checkbox Enable lighting to enable lighting. Otherwise no lighting will be used and the controls on the Lighting page of the Picture Settings dialog are not available.

Position of light source

The three input fields Light source vector;... define the x-, y-, and z-component of the directional vector of the light source in view coordinates. This vector points from the center of rotation towards the light source, which is infinitely far away. If the vector is set to (-1, 1, 1) e.g., the light comes from the upper left front.

The light is made up of three components:

Ambient light

This light does not come from any particular direction, because the rays of light have bounced around the scenery and become directionless. Objects are lit evenly on all parts in all directions by the ambient light component. Ambient light gives the whole scenery a basis brightness.

Diffuse light

This light comes from a particular direction but is reflected evenly off a surface. Even though the light is reflected evenly, the object surface is brighter if the light is pointed directly at the surface than if the light grazes the surface from an angle.

Specular light

This light is directional like diffuse light, but is reflected sharply and in a particular direction. A highly specular light tends to cause a bright spot on the surface it shines upon.

Default values

The ambient light is white with an intensity of 30 percent, that means red, green, and blue component of the ambient light are r = g = b = 0.3, whereas the diffuse light has 80 percent, and the specular light the maximum intensity of 100 percent.

Note: These values could be changed in version 2 of Diamond, but not more since version 3.

The shape of an object's surface (for example of an atom) derives from an interaction between the composition of the light source (which is a global setting for the whole scenery) and the object's individual surface properties. These surface properties are individually defined for each atom, bond, and polyhedron face.

 


Previous article: Background
Next article: Other effects