-
Notifications
You must be signed in to change notification settings - Fork 27
Light
FUDGE implements a simple light system. There are four types of light: ambient, directional, point and spot. Using a ComponentLight, lights are attached to nodes. Besides the type, two properties define a light further: the color and the pivot matrix. In the following graphics, the pivot matrix is represented in two dimensions, just as viewed along its x-axis. The scaling seen is along the y- and z-axis, the rotation around the x-axis and the translation at some point in space. Principles apply to the other dimensions equally.
This is purely diffuse light equally distributed in space without any direction, like on a day with overcast sky. The pivot matrix is ignored.
Parallel light without any attenuation or origin, like the sunlight on a cloudless day. Only the rotation of the pivot matrix is evaluated to define the direction.
Light shining in all directions from a single point in space, like from a light bulb or a candle. The light has limited range with an intensity decreasing linearly from 1 in the center to 0 at the perimeter of a sphere. The sphere may be unequally scaled to form an oval or a disc, which allows for visible rotation. The pivot matrix defines location, scaling and rotation of that sphere.
Shines in one specific direction with limited range and spread to the sides, like a flashlight, creating a cone (pyramid at this time) shaped lit volume. The intensity decreases linearly from 1 at the position of the light to 0 at the perimeter of that shape. The pivot matrix defines the location of the light and, defined as with the directional light, the direction to point in. The z-scaling defines the range in this direction, the x and y components the maximum spread at that range.