Module light

Module light 

Source
Expand description

Contains all structures and methods to create and manage lights.

Light sources arte basic building blocks of many scenes in games, it improves perception of scene and makes it look natural. Fyrox engine supports three kinds of light sources:

  1. Directional - similar to sun in real life, its rays are parallel.
  2. Spot - similar to flash light, it has cone light volume and circle spot.
  3. Point - similar to light bulb, it has spherical light volume.

Each kind of light source is suitable for specific conditions, for example spot light can be used if you have a character with flashlight, point - if you have a character with torch, and finally directional - for outdoor light.

Most of light sources supports shadows (via shadows maps) and light scattering, these are common effects for modern games but still can significantly impact performance.

Modules§

directional
Directional light is a light source with parallel rays, it has excellent example in real life - Sun. It does not have position, only direction which defined by parent light scene node.
point
Point light can be represented as light bulb which hangs on wire - it is spherical light source which emits light in all directions. It has single parameter - radius at which intensity will be zero. Intensity of light will be calculated using inverse square root law.
spot
Spot light is can be imagined as flash light - it has direction and cone shape of light volume. It defined by two angles:

Structs§

BaseLight
Light scene node. It contains common properties of light such as color, scattering factor (per color channel) and other useful properties. Exact behavior defined by specific light kind.
BaseLightBuilder
Light scene node builder. Provides easy declarative way of creating light scene nodes.

Constants§

DEFAULT_SCATTER_B
Default amount of light scattering, it is set to 3% which is fairly significant value and you’ll clearly see light volume with such settings.
DEFAULT_SCATTER_G
Default amount of light scattering, it is set to 3% which is fairly significant value and you’ll clearly see light volume with such settings.
DEFAULT_SCATTER_R
Default amount of light scattering, it is set to 3% which is fairly significant value and you’ll clearly see light volume with such settings.