Книга: DirectX 8 Programming Tutorial

Attributes of a light

Attributes of a light

For different lights you can specify different attributes. Not all lights use all of the attributes that are listed below:

Position

This is the position in 3D space where the light source is located. This will be a coordinate in 3D space such as (0, 10, 0).

Direction

This is the direction in which light is emitted from the light source. This will be a vector such as (0, –1, 0).

This is the maximum distance from the light source that the light will travel. Any objects that are out of range will not receive light from this light source.

Attenuation

This is how light changes over distance. This is normally the rate that light fades out between the light source and lights range. You can specify that light does not fade out or that it gets brighter over distance if you want to.

Diffuse Light

This is the colour of diffuse light that is emitted by the light. Diffuse light is light that has been scattered, but it still has direction as opposed to ambient light that does not.

Ambient Light

This is the colour of ambient light that is emitted by the light. Ambient light is general background light. Ambient light has been scattered so much that it does not have a direction or source and is at the same everywhere in the scene.

Specular Light

This is the colour of specular light that is emitted by the light. Specular light is the opposite of diffuse light. Specular light is not scattered at all, you can use specular light to create highlights on your objects.

Оглавление книги


Генерация: 1.391. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз