Lighting¶

Introduction¶

Lights emit light that mix with the materials and produces a visible result. Light can come from several types of sources in a scene:

  • From the Cloth itself, in the grade of the emission colour (though it does non affect nearby objects unless baked).
  • Light Nodes: Directional, Omni and Spot.
  • Ambient Light in the Environment.
  • Baked Light (read doc_light_baking).

The emission color is a material property. You can read more than about it in the Fixed materials tutorial.

Light nodes¶

As mentioned before, in that location are iii types of light nodes: Directional, Omni and Spot. Each has different uses and will be described in item below, but first let's take a look at the common parameters for lights:

../../../_images/light_params.png

Each 1 has a specific function:

  • Enabled: Light is emitted only if this flag is ready.
  • Broil Way: When using the light baker, the role of this light can be defined in this enumerator. The part will be followed even if the light is disabled, which allows to configure a light and and then disable it for blistering.
  • Energy: This value is a multiplier for the lite, it's specially useful for High dynamic range and for Spot and Omni lights, because it can create very brilliant spots near the emitter.
  • Diffuse and Specular: These calorie-free values get multiplied by the textile light and diffuse colors. A white value does not mean that light will be white, but that the material color will exist kept.
  • Operator: It is possible to make some lights negative for a concealment outcome.
  • Projector: Lights tin can project a texture for the diffuse light (currently only supported in Spot light).

Directional light¶

This is the most common type of lite and represents a light source very far abroad (such as the lord's day). It is also the cheapest light to compute and should be used whenever possible (although information technology'south non the cheapest shadow-map to compute, but more on that later).

Directional low-cal models an infinite number of parallel light rays roofing the whole scene. The directional light node is represented by a large arrow, which indicates the direction of the light rays. However, the position of the node does non touch on the lighting at all, and tin can be anywhere.

../../../_images/light_directional.png

Every face whose front-side is hitting by the lite rays is lit, the others stay night. Most low-cal types accept specific parameters but directional lights are pretty uncomplicated in nature then they don't.

Omni low-cal¶

Omni low-cal is a point source that emits light spherically in all directions upwardly to a given radius (distance from the node'south position). The radius is a parameter of the light and can exist controlled by the user. But as in real life, the intensity of omni light decreases with the distance and vanishes at the divers radius. Omni calorie-free sources should exist used to represent lamps or bulbs or whatever other light source that originates approximately in a point.

../../../_images/light_omni.png

In reality, the attenuation of omni light is proportional to the squared distance from the signal source. This can be easily understood if you imagine a sphere around the omni light with a sure radius. No matter how large the sphere is, the number of rays passing through information technology is e'er the same. If the radius of the sphere is doubled, the area of the sphere increases by 4. In other words, the density of rays (the number of rays per square area) decreases quadratically with the distance.

Inverse-quadratic attenuation curves are inconvenient for artists: they never reach aught and accept almost infinitely large values nigh the emitter. So Godot simulates omni light with an artist-controlled exponential curve instead.

../../../_images/light_attenuation.png

Spot low-cal¶

Spot lights are similar to omni lights, except they emit light but into a cone (or "cutoff"). They are useful to simulate flashlights, motorcar lights, etc. This kind of light is as well adulterate towards the opposite direction information technology points to.

../../../_images/light_spot.png

Ambient low-cal¶

Ambience light tin can be plant in the backdrop of a WorldEnvironment (remember only i of such can exist instanced per scene). Ambience lite consists of a uniform calorie-free and free energy. This calorie-free is applied the same to every unmarried pixel of the rendered scene, except to objects that used broiled light.

Baked light¶

Broiled lite stands for pre-computed ambience light. Information technology can serve multiple purposes, such every bit blistering light emitters that are not going to be used in existent-fourth dimension, and blistering light bounces from existent-time lights to add more realism to a scene (see doc_light_baking tutorial for more than data).