|
@@ -16,14 +16,14 @@ result. Light can come from several types of sources in a scene:
|
|
:ref:`Environment <class_Environment>`.
|
|
:ref:`Environment <class_Environment>`.
|
|
- Baked Light (read :ref:`doc_light_baking`).
|
|
- Baked Light (read :ref:`doc_light_baking`).
|
|
|
|
|
|
-The emission color is a material property, as seen in the previous
|
|
|
|
-tutorials about materials (go read them if you didn't at this point!).
|
|
|
|
|
|
+The emission color is a material property. You can read more about it
|
|
|
|
+in the :ref:`doc_fixed_materials` tutorial.
|
|
|
|
|
|
Light nodes
|
|
Light nodes
|
|
-----------
|
|
-----------
|
|
|
|
|
|
As mentioned before, there are three types of light nodes: Directional,
|
|
As mentioned before, there are three types of light nodes: Directional,
|
|
-Ambient and Spot. Each has different uses and will be described in
|
|
|
|
|
|
+Omni and Spot. Each has different uses and will be described in
|
|
detail below, but first let's take a look at the common parameters for
|
|
detail below, but first let's take a look at the common parameters for
|
|
lights:
|
|
lights:
|
|
|
|
|
|
@@ -31,17 +31,17 @@ lights:
|
|
|
|
|
|
Each one has a specific function:
|
|
Each one has a specific function:
|
|
|
|
|
|
-- **Enabled**: Lights can be disabled at any time.
|
|
|
|
|
|
+- **Enabled**: Light is emitted only if this flag is set.
|
|
- **Bake Mode**: When using the light baker, the role of this light can
|
|
- **Bake Mode**: When using the light baker, the role of this light can
|
|
be defined in this enumerator. The role will be followed even if the
|
|
be defined in this enumerator. The role will be followed even if the
|
|
light is disabled, which allows to configure a light and then disable
|
|
light is disabled, which allows to configure a light and then disable
|
|
it for baking.
|
|
it for baking.
|
|
- **Energy**: This value is a multiplier for the light, it's specially
|
|
- **Energy**: This value is a multiplier for the light, it's specially
|
|
useful for :ref:`doc_high_dynamic_range` and for Spot and Omni lights, because it can
|
|
useful for :ref:`doc_high_dynamic_range` and for Spot and Omni lights, because it can
|
|
- create very bright spots near the emissor.
|
|
|
|
|
|
+ create very bright spots near the emitter.
|
|
- **Diffuse and Specular**: These light values get multiplied by the
|
|
- **Diffuse and Specular**: These light values get multiplied by the
|
|
- material light and diffuse colors, so a white value does not mean
|
|
|
|
- that light will be white, but that the original color will be kept.
|
|
|
|
|
|
+ material light and diffuse colors. A white value does not mean
|
|
|
|
+ that light will be white, but that the material color will be kept.
|
|
- **Operator**: It is possible to make some lights negative for a
|
|
- **Operator**: It is possible to make some lights negative for a
|
|
darkening effect.
|
|
darkening effect.
|
|
- **Projector**: Lights can project a texture for the diffuse light
|
|
- **Projector**: Lights can project a texture for the diffuse light
|
|
@@ -50,35 +50,46 @@ Each one has a specific function:
|
|
Directional light
|
|
Directional light
|
|
~~~~~~~~~~~~~~~~~
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
-This is the most common type of light and represents the sun. It is also
|
|
|
|
|
|
+This is the most common type of light and represents a light source
|
|
|
|
+very far away (such as the sun). It is also
|
|
the cheapest light to compute and should be used whenever possible
|
|
the cheapest light to compute and should be used whenever possible
|
|
(although it's not the cheapest shadow-map to compute, but more on that
|
|
(although it's not the cheapest shadow-map to compute, but more on that
|
|
-later). Directional light nodes are represented by a big arrow, which
|
|
|
|
-represent the direction of the light, however the position of the node
|
|
|
|
|
|
+later).
|
|
|
|
+
|
|
|
|
+Directional light models an infinite number of parallel light rays
|
|
|
|
+covering the whole scene. The directional light node is represented by a big arrow, which
|
|
|
|
+indicates the direction of the light rays. However, the position of the node
|
|
does not affect the lighting at all, and can be anywhere.
|
|
does not affect the lighting at all, and can be anywhere.
|
|
|
|
|
|
.. image:: /img/light_directional.png
|
|
.. image:: /img/light_directional.png
|
|
|
|
|
|
-Basically what faces the light is lit, what doesn't is dark. Most lights
|
|
|
|
|
|
+Every face whose front-side is hit by the light rays is lit, the others stay dark.
|
|
|
|
+Most light types
|
|
have specific parameters but directional lights are pretty simple in
|
|
have specific parameters but directional lights are pretty simple in
|
|
nature so they don't.
|
|
nature so they don't.
|
|
|
|
|
|
Omni light
|
|
Omni light
|
|
~~~~~~~~~~
|
|
~~~~~~~~~~
|
|
|
|
|
|
-Omni light is a point that throws light all around it up to a given
|
|
|
|
-radius (distance) that can be controlled by the user. The light
|
|
|
|
-attenuates with the distance and reaches 0 at the edge. It represents
|
|
|
|
-lamps or any other light source that comes from a point.
|
|
|
|
|
|
+Omni light is a point source that emits light spherically in all directions up to a given
|
|
|
|
+radius (distance from the node's position). The radius is a parameter of the light and
|
|
|
|
+can be controlled by the user. Just as in real life, the intensity of omni light
|
|
|
|
+decreases with the distance and vanishes at the defined radius. Omni light sources
|
|
|
|
+should be used to represent lamps or bulbs or any other light source that originates
|
|
|
|
+approximately in a point.
|
|
|
|
|
|
.. image:: /img/light_omni.png
|
|
.. image:: /img/light_omni.png
|
|
|
|
|
|
-The attenuation curve for these kind of lights in nature is computed
|
|
|
|
-with an inverse-quadratic function that never reaches zero and has
|
|
|
|
-almost infinitely large values near the emissor.
|
|
|
|
|
|
+In reality, the attenuation of omni light is proportional to the squared distance
|
|
|
|
+from the point source. This can be easily understood if you imagine a sqhere around
|
|
|
|
+the omni light with a certain radius. No matter how large the sphere is, the number
|
|
|
|
+of rays passing through it is always the same. If the radius of the sphere is doubled,
|
|
|
|
+the area of the sphere increases by four. In other words, the density of rays
|
|
|
|
+(the number of rays per squere area) decreases quadratically with the distance.
|
|
|
|
|
|
-This makes them considerably inconvenient to tweak for artists, so
|
|
|
|
-Godot simulates them with an artist-controlled exponential curve
|
|
|
|
|
|
+Inverse-quadratic attenuation curves are inconvenient for artists: they
|
|
|
|
+never reach zero and have almost intinitely large values near the emitter.
|
|
|
|
+So Godot simulates omni light with an artist-controlled exponential curve
|
|
instead.
|
|
instead.
|
|
|
|
|
|
.. image:: /img/light_attenuation.png
|
|
.. image:: /img/light_attenuation.png
|
|
@@ -86,8 +97,8 @@ instead.
|
|
Spot light
|
|
Spot light
|
|
~~~~~~~~~~
|
|
~~~~~~~~~~
|
|
|
|
|
|
-Spot lights are similar to Omni lights, except they only operate between
|
|
|
|
-a given angle (or "cutoff"). They are useful to simulate flashlights,
|
|
|
|
|
|
+Spot lights are similar to omni lights, except they emit light only into a cone
|
|
|
|
+(or "cutoff"). They are useful to simulate flashlights,
|
|
car lights, etc. This kind of light is also attenuated towards the
|
|
car lights, etc. This kind of light is also attenuated towards the
|
|
opposite direction it points to.
|
|
opposite direction it points to.
|
|
|
|
|
|
@@ -106,6 +117,6 @@ Baked light
|
|
-----------
|
|
-----------
|
|
|
|
|
|
Baked light stands for pre-computed ambient light. It can serve multiple
|
|
Baked light stands for pre-computed ambient light. It can serve multiple
|
|
-purposes, such as baking light emissors that are not going to be used in
|
|
|
|
|
|
+purposes, such as baking light emitters that are not going to be used in
|
|
real-time, and baking light bounces from real-time lights to add more
|
|
real-time, and baking light bounces from real-time lights to add more
|
|
realism to a scene (see Baked Light]] tutorial for more information).
|
|
realism to a scene (see Baked Light]] tutorial for more information).
|