home | login | register | DMCA | contacts | help | donate |

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
А Б В Г Д Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Э Ю Я

 fantasy space fantasy fantasy is horrors heroic prose   military   child   russian detective   action   child   ironical   historical   political western adventure adventure (child) child's stories love religion antique Scientific literature biography business home pets animals art history computers linguistics mathematics religion home_garden sport technique publicism philosophy chemistry close

## Types of lighting

There are four types of lights that you can create in your scene, each of which have their own behaviours and attributes.

Ambient Light

As well as being an attribute of light, you can create a general ambient light level for the scene that is independent of other lights. You can specify how much ambient light there is and what colour it is. You can define the colour by specifying it's red, green and blue (RGB) values.

Point Light

An example of a point light is a light bulb. It has a position but no direction because light is emitted in all directions equally. It also has colour, range and attenuation attributes that can be set. Fig 7.1 below, shows how light is emitted from a point light.

Fig 7.1

Directional Light

Directional lights have direction and colour but no position, an example of a directional light would be something like the sun. All objects in your scene will receive the same light from the same direction. Directional lights do not have range or attenuation attributes. Fig 7.2 below, shows how light is emitted from a directional light.

Fig 7.2

Spotlight

An example of a spot light would be something like a torch. Spotlights have position, direction, colour, attenuation and range. For a spotlight you can define an inner and outer cone each of which has a light value that is blended between the two. You define the cones by specifying their angle, the inner cone's angle is known as Theta and the outer cone's angle is known as Phi. You define how the illumination between a spotlight's inner and outer cone changes by specifying the lights Falloff property. Fig 7.3 below, shows how light is emitted from a spot light.

Fig 7.3

All lights add a computational overhead to your application, some more than others. The light with the least overhead is ambient light, followed by directional lights, then point lights and finally, the lights with the most overhead are spot lights. Think about this when you are deciding what lights to use in your application.

Attributes of a light | DirectX 8 Programming Tutorial | Materials