From BlenderWiki

Jump to: navigation, search
Blender3D FreeTip.gif
IMPORTANT! Do not update this page!
We have moved the Blender User Manual to a new location. Please do not update this page, as it will be locked soon.

Ztlumení světla

Mód: Všechny módy

Panel: Stínování → menu Světlo

Klávesová zkratka: F5


Popis

Lamp Základní ovládací panel pro postupné ubývání světla je zvýrazněn žlutě.

Možnosti postupného ubývání světla byly přidány v Blenderu 2.46, alespoň pro světlo typu Lamp a Spot. Jsou zde dvě základní nastavení: tlačítko Sphere a vysouvací seznam návrhů různých typů ubývání světla, jak jsou popsány níže.

Nastavení

Sphere
Nastavení Sphere omezuje dosah záře světla tak, že bude úplně zastaveno osvětlování oblasti, která přesahuje počet Blender jednotek, zadaných v poli Dist:.
Pomyslný kruh (s poloměrem podle pole Dist:) je umístěn okolo světelného zdroje a určuje hranici, kde intenzita světla mizí. Abychom dosáhli tohoto cíle, nastavení Sphere přidává pravidlo vybraného zákon pohlcení, kterým je:
I’ = I × (D - r) / D if r < D; 0 v jiném případě
Kde I’ je požadovaná intenzita světla (s aktivovaným nastavením Sphere);
Kde I intenzita světla počítaná podle vybraného zákona pohlacení (bez nastavení Sphere);
Kde D je současné nastavení pole Dist:;
Kde r je vzdálenost od světla, kde je světelná intenzita měřena.
Podívej se také na graf, který je na konci popisu nastavení ztlumení typu “Lin/Quad Weight”…
Render ukazující pohlcení světla při nastavení úbytku světla na Constant s aktivovaným Sphere.
Render ukazující pohlcení světla při nastavení úbytku světla na Constant s neaktivovaným Sphere.
Když je volba Sphere aktivována, objeví se tečkovaný kruh okolo světelného zdroje označující hranici, kde bude intenzita světla nulová. Příklad uveden níže:
Obrázek 3D okna ukazující kruh Sphere, kde bude světlo "odstřiženo".

A nyní všechny typy útlumu světla dle seznamu ve vysouvacím menu:

Lin/Quad Weight
Tento útlum světla je popsáno v Blender 2.46 release notes následovně:
« V podstatě je to stejné jako ve starších verzích Blenderu staré povolující tlačítko Quad. Pokud je toto nastavení vybráno, ukáží se dva posuvníky: Linear a Quad (předtím Quad1 a Quad2), které kontrolují navzájem "lineárnost" a "kvadratičnost" křivky utlumu světla. Světla ve starých souborech s aktivovaným tlačítkem Quad budou převedny to tohoto nastavení. »
Panel Světlo s vybraným typem útlumu světla Lin/Quad Weighted a Quad a Linear posuvníky také zvýraněnými žlutě.
Takto to vypadá, když útlum světla typu Lin/Quad Weighted dovoluje ve výsledku mixovat dva profily světelného zeslabování (Lineární typ zeslabení a kvadratický typ zeslabení).
Zde je obrázek Lin/Quad Weighted světla se základním nastavením:
Render ukazující efekt útlum světla typu Lin/Quad Weighted při základním nastavení.
Linear
Tento posuvník/pole pro číselné zadání může mít hodnotu mezi 0 a 1. Hodnota 1 v poli Linear a 0 v poli Quad v důsledku znamená, že světlo od tohoto zdroje je úplně lineární. Znamená to, že intenzita tohoto světelného zdroje bude na poloviční hodnotě, jakmile dosáhne vzdálenosti rovné počtu Blender jednotek zadaných v poli Dist:.
Když Quad posuvník je nastaven na 0, the formula for working out the Attenuation at a particular range for Linear Attenuation is, in effect:
I = E × (D / (D + L × r))
Where I is the calculated Intensity of light.
Where E is the current Energy slider setting.
Where D is the current setting of the Dist: field.
Where L is the current setting of the Linear slider.
Where r is the distance from the lamp where the light Intensity gets measured.
Quad
Quad (Quadratic) Attenuation type lighting is considered a more accurate representation of how light Attenuates, and as such when the Lin/Quad Weighted Lamp Fallout type is selected, Fully Quadratic Attenuation is selected by default (that is the Quad slider field is 1 and the Linear slider field is 0).
This slider/numeric input field, can have a value between 0 and 1. A value of 1 in the Quad field and 0 in the Linear field, in effect means that the light from this source is completely Quadratic (Quad type).
In the situation just described the Quad Falloff type is being completely respected so it has the Intensity value it should have (half intensity) by the time it reaches the distance specified in the Dist: field. After the light has reached the distance in the Dist: field, the light decays much more quickly.
One of the characteristics of Quadratic Light Attenuation is that at first it gradually Attenuates and then at a certain point starts to Attenuate at a much faster rate. The faster rate stage of Attenuation is roughly entered when the distance from the light is more than the value in the Dist: field.
When the Linear slider is set to 0 the formula for working out the attenuation at a particular range for Quadratic attenuation is, in effect:
I = E × (D2 / (D2 + Q × r2))
Where I is the calculated Intensity of light.
Where E is the current Energy slider setting.
Where D is the current setting of the Dist: field.
Where Q is the current setting of the Quad slider.
Where r is the distance from the lamp where the light Intensity gets measured.
Light Attenuation profile when both Linear and Quad sliders have values greater than 0
If both the Linear and Quad slider fields have values greater than 0, then the formula used to calculate the Light Attenuation profile changes to this:
I = E × (D / (D + L × r)) × (D2 / (D2 + Q × r2))
Where I is the calculated Intensity of light.
Where E is the current Energy slider setting.
Where D is the current setting of the Dist: field.
Where L is the current setting of the Linear slider.
Where Q is the current setting of the Quad slider.
Where r is the distance from the lamp where the light Intensity gets measured.
No Light Attenuation when both Linear and Quad sliders have values of 0.
If both the Linear and Quad sliders have 0 as their values, the light Intensity will not Attenuate with distance. This does not mean that the light will not get darker, it will, but only because the Energy the light has is spread out over a wider and wider distance. The total amount of Energy in the spread out light will remain the same though. Light angle also affects the amount of light you see. If what you want is a light source that doesn’t attenuate and gives the same amount of light Intensity to each area it hits you need a light with properties like the Constant Lamp Falloff type.
Also when the Linear and Quad sliders are both 0 values the Dist: field ceases to have any visible effect on the Light Attenuation.
Here is a graph summarising everything above, in a more visual fashion. Note that it also illustrates the Sphere option’s effects:
Light Attenuation:
a) Linear (Linear=1.0, Quad=0.0); b) Quadratic (Linear=0.0, Quad=1.0);
c) Linear and quadratic (Linear=Quad=0.5); d) Null (Linear=Quad=0.0).
Also shown in the graph the “same” curves, in the same colours, but with the Sphere button turned on.
Custom Curve
The Custom Curve Lamp Falloff type became available in Blender 2.46 and is very flexible.
Lamp Panel with Lamp Falloff type Custom Curve selected and highlighted in Yellow. Also shown is the Falloff Curve tab that is created (also highlighted in Yellow) when Custom Curve falloff type is in effect.
Most other Lamp Falloff types work by having their light Intensity start at its maximum (when nearest to the Light source) and then with some predetermined pattern decrease their light Intensity when the Distance from the light source gets further away.
When using the Custom Curve Lamp Falloff type, a new panel is created called Falloff Curve shown below:
Falloff Curve panel used to control the amount of Light Attenuation a light has in an arbitrary manner.
This Falloff Curve Profile Graph, allows the user to alter how Intense light is at a particular point along a lights Attenuation Profile.
In the example above (the default for the Falloff Curve Profile Graph), the Graph shows that the Intensity of the light starts off at the maximum Intensity that the light can have (when near the light) and linearly Attenuates the light Intensity as it moves to the right (further away from the light source).
So if the user wanted to have a Light Attenuation Profile that got more Intense as it moved away from the light source, the user could alter the Light Attenuation Profile Graph as needed. Below is an example of a Falloff Curve Profile Graph, showing just such a situation:
Falloff Curve for reversed Attenuation.
Falloff Curve for reversed Attenuation rendered.
You are not just limited to simple changes such as light reversing the Attenuation profile, you can have almost any Attenuation profile you desire.
The Falloff Curve Profile Graph has 2 axis, the Intensity axis and the Distance axis, labelled Intensity and Distance in the pictures shown (although these labels were added to make describing how the Falloff Curve Profile Graph works, easier, they don’t appear in Blender).
The Distance axis represents the position at a particular point along a light sources Attenuation path. The far left being at the the position of the light source and the far right being the place where the light sources influence would normally be completely Attenuated. I say normally would because the Falloff Curve can be altered to do the exact opposite if required.
The Intensity axis represents the Intensity at a particular point along a light sources Attenuation path. Higher Intensity is represented by being higher up the Intensity axis while lower Intensity light is represented by being lower down on the Intensity axis.
Here is another example of different Falloff Curve Profile Graph, along with its resultant render output:
Falloff Curve Profile Graph resulting in Oscillating Attenuation pattern in Light.
Render showing the affect of the Falloff Curve Profile Graph on the Attenuation.
Altering the Falloff Curve Profile Graph is easy. Just LMB Template-LMB.png on a part of the graph you want to alter and drag it where you want it to be. If when you click you are over or near one of the tiny black square handles, it will turn white indicating that this is the handle that is now selected and you will be able to drag it to a new position. If when you click on the graph you are not near a handle, one will be created at the point that you clicked, which you can then drag where you wish.
Inverse Square
This Lamp Fallout type Attenuates its Intensity according to inverse square law, scaled by the Dist: value. Inverse square is a sharper, realistic decay, useful for lighting such as desk lamps and street lights. This is similar to the old Quad option (and consequently, to the new Lin/Quad Weight option with Linear to 0.0 and Quad to 1.0), with slight changes (TODO: Is it true? What changes? -- Mont29 13:46, 2 May 2009 (UTC)).
Render showing the Inverse Square Lamp Falloff type effect with default settings.
Inverse Linear
This Lamp Fallout type Attenuates its Intensity linearly, scaled by the Dist: value. This is the default setting, behaving the same as the default in previous Blender versions without Quad switched on, and consequently, as the new Lin/Quad Weight option with Linear to 1.0 and Quad to 0.0 (TODO: Is it true? -- Mont29 13:46, 2 May 2009 (UTC)). This isn’t physically accurate, but can be easier to light with.
Render showing the Inverse Linear Lamp Falloff type effect with default settings.
Constant
This Lamp Fallout type does not Attenuate its Intensity with distance. This is useful for distant light sources like the sun or sky, which are so far away that their falloff isn’t noticeable. Sun and Hemi lamps always have constant falloff.
Render showing the Constant Lamp Falloff type effect with default settings.


Examples

Distance

In this example, the Lamp has been set pretty close to the group of planes. This causes the light to affect the front, middle and rear planes more dramatically. Looking at (Various Distance settings) you can see that as the Dist is increased more and more objects are becoming progressively brighter.

Dist: 10.
Dist: 100.
Dist: 1000.
Various Distance settings, Shadow disabled.

The Dist: parameter is controlling where the light is falling – at a linear rate by default – to 1/2 its original value from the light’s origin. As you increase or decrease this value you are changing where this 1/2 falloff occurs. You could think of Dist: as the surface of a sphere and the surface is where the light’s intensity has fallen to 1/2 its strength, in all directions. Note that the light’s intensity continues to fall even after Dist:. Dist: just specifies the distance where 1/2 of the light’s energy has weakened.

Notice in (Dist: 1000) that the farthest objects are very bright. This is because the falloff has been extended far into the distance which means the light is very strong when it hits the last few objects. It is not until 1000 units that the light’s intensity has fallen to 1/2 its original intensity.

Contrast this with (Dist: 10) where the falloff occurs so soon that the farther objects are barely lit. The light’s intensity has fallen by 1/2 by time it even reaches the 10th object.

You may be wondering, why the first few planes appear to be dimmer? This is because the surface angle between the light and the object’s surface normal are getting close to oblique. That is the nature of a Lamp light object. By moving the light infinitely far away you would begin to approach the characteristics of the Sun lamp type.

Inverse Square

Inverse Square makes the light’s intensity falloff with a non-linear rate, or specifically, quadratic rate. The characteristic feature of using Inverse Square is that the light’s intensity begins to fall off very slowly but then starts falling off very rapidly. We can see this in the (Inverse Square selected) images.

Inverse Square with 10.
Inverse Square with 100.
Inverse Square with 1000.
Inverse Square selected with the specified distances.

With Inverse Square selected the Dist: field is specifying where the light begins to fall faster, roughly speaking, see the light attenuation options for more info.

In (Inverse Square with 10) the light’s intensity has fallen so quickly that the last few objects aren’t even lit.

Both (Inverse Square with 100) and (Inverse Square with 1000) appear to be almost identical and that is because the Distance is set beyond the farthest object’s distance which is at ~40 units out. Hence, all the objects get almost the full intensity of the light.

As above, the first few objects are dimmer than farther objects because they are very close to the light. Remember, the brightness of an object’s surface is also based on the angle between the surface normal of an object and the ray of light coming from the lamp.

This means there are at least two things that are controlling the surface’s brightness: intensity and the angle between the light source and the surface’s normal.

Sphere

Clipping Sphere.

Sphere controls where the light’s intensity is clipped/clamped off. All light rays attenuate to zero at the surface of the sphere, regardless of the light’s falloff. In (Clipping Sphere) you can see a side view example of the setup with Sphere enabled and a distance of 10.

Any objects beyond the sphere receive no light from the lamp.

The Dist: field is now specifying both where the light’s rays become null, and the intensity’s ratio falloff setting. Note that there is no abrupt transition at the sphere: the light attenuation is progressive (for more details, see the description of the Sphere and light attenuation options, in the “Options” section above).

Sphere with 10.
Sphere with 20.
Sphere with 40.
Sphere enabled with the specified distances, Inverse Linear light falloff.

In (Sphere with 10) the clipping sphere’s radius is 10 units which means the light’s intensity is also being controlled by 10 units of distance. With a linear attenuation, the light’s intensity has fallen very low even before it gets to the first object.

In (Sphere with 20) the clipping sphere’s radius is now 20 units and some light is reaching the middle objects.

In (Sphere with 40) the clipping sphere’s radius is now 40 units which is beyond the last object. However, the light doesn’t make it to the last few objects because the intensity has fallen to nearly 0.

Hints

If a Lamp light is set to not cast shadows, it illuminates through walls and the like. If you want to achieve some nice effects like a fire, or a candle-lit room interior seen from outside a window, the Sphere option is a must. By carefully working on the Distance value you can make your warm firelight shed only within the room, while illuminating outside with a cool moonlight, the latter achieved with a Sun or Hemi light or both.

See Also