From BlenderWiki
[edit] What is Volumetric Lighting?
According to Wikipedia, Volumetric Lighting is as described Below:
- "Volumetric lighting is a technique used in 3D computer graphics to add Tyndall-effect lighting to a rendered scene. The term seems to have been introduced from cinematography and is now widely applied to 3D modelling and rendering especially in the field of 3D gaming. It allows the viewer to see beams of light shining through the environment; seeing sunbeams streaming through an open window is an example of volumetric lighting, also known as God rays.
- In volumetric lighting, the light cone emitted by a light source is modeled as a transparent object and considered as a container of a "volume": as a result, light has the capability to give the effect of passing through an actual three dimensional medium (such as fog, dust, smoke, or steam) that is inside its volume, just like in the real world."
A classic example is the Search light with a visible Halo/Shaft of light being emitted from it as the search light sweeps around.
| Blend file of Spotlight Animation |
By default Blender does not model this aspect of light. For example when Blender lights something with a Spotlight you see the Objects and area on the floor lit but not the Shaft/Halo of light coming from the Spotlight as it progresses to its target and would get scattered on the way.
The Halo/Shaft of light is caused in the real world by light being scattered by particles in the air, some of which get diverted into your eye and that you perceive as a Halo/Shaft of light. The scattering of light from a source can be simulated in Blender using various options, but by default is not activated.
- SpotSi:
- The SpotSi (SpotSize) Numeric Slider field controls the size of the outer cone of a Spotlight, which largely controls the circular area a Spotlights light covers. It does this by altering the Angle from the position of the Spotlight to the outer cone of the Spotlight. The SpotSi Numeric Slider field represents that Angle. The SpotSi value can be from 1 degree to 180 degrees.
- SpotBL:
- SpotBL (SpotBLur) Numeric Slider field controls the inner cone of the Spotlight. The SpotBL value can be between 0 and 1. The value is proportional and represents that amount of space that the inner cone should occupy inside the outer cone (SpotSi).
- The inner cone boundary line indicates the point at which light from the Spotlight will start to Blur/Soften, before this point the Spotlights light will mostly be full strength. The larger the value of the SpotBL the more Blurred/Soft the edges of the Spotlight will be and the smaller the inner cones circular area will be (as it starts to Blur/Soften earlier).
- To make the Spotlight have a sharper falloff rate and therefore less Blurred/Soft edges, decrease the value of SpotBL. Setting SpotBL to 0 results in very sharp Spotlight edges with almost no soft edge.
- The falloff rate of the Spotlight light is a ratio between the SpotBL and SpotSi values, the larger the circular gap between the 2 the more gradual the light fades between SpotBL and SpotSi.
- You can directly control the effective diameter of the Spotlights circle by adjusting the SpotSi property or indirectly by adjusting the Dist: property. The gap between SpotBL and SpotSi remains constant for changes to Dist:.
- SpotBL and SpotSi only control the Spotlight cone's softness or falloff, it does not control the shadow's softness as shown below.
- Notice in the picture above that the "Object's shadow" is sharp as a result of the raytracing, where as the Spotlights edges are soft. It you want other items to cast soft shadows within the Spotlights area you will need to alter other settings.
- HaloInt:
- The HaloInt (Halo Intensity) Numeric Slider field controls how Intense/Dense the Volumetric effect is that is generated from the light source. The HaloInt value has a range of between 0 and 5. By Default the value of the HaloInt Numeric Slider field is ignored because the Halo button is not active. To make HaloInt have an effect make sure the Halo button is active. The lower the value of the HaloInt slider the less visible the Volumetric effect is, while higher HaloInt values give a much more noticeable and dense volumetric effect.
- Blender only simulates Volumetric lighting in Spotlights when using Blenders Internal Renderer. This can lead to some strange results for certain combinations of settings for Light Energy and HaloInt.
- For example having a Spotlight with 0 or very low light Energy settings but a Very high HaloInt setting can result in Dark/Black Halos, which would not happen in the real world. Just be aware of this possibility when using Halos with Blenders Internal Renderer.
- Halo:
- The Halo button allows a Spotlight to have a Volumetric effect applied to it. This button must be active if the Volumetric effect is to be visible.
- Square:
- The Square button makes a Spotlight cast a square light area, rather than the default circular one.
- Sphere
- The Sphere option restricts the Spotlights illumination range so that it will instantly stop illuminating past an area once it reaches the number of Blender Units away from itself, as specified in the Dist: field.
- An imaginary Sphere (with a radius of the Dist: field) is placed around the Spotlight source and it's light is blocked from passing through the Sphere walls. So the Dist: field now basically means that any light that is further away form its light source than the value in the Dist: field will be Attenuated to 0 after this point, and won't naturally attenuate but instantly stop.
- When the Sphere option is active, an imaginary Sphere will be projected around the light source, indicating the demarcation point at which this lights propagation will cease, example below:
- Lin/Quad Weight
- This Lamp Falloff is described in the Blender 2.46 release notes as follows:
- "Exactly the same as in older Blenders with the old 'Quad' button enabled. When this setting is chosen, two sliders are shown, 'Linear' and 'Quad' (previously Quad1 and Quad2), which controls the 'linearness' or 'quadraticness' of the falloff curve. Lamps in old files with the 'Quad' button on will be initialised to this setting."
- So it looks as if the Lin/Quad Weighted Lamp Falloff type is in effect allowing the mixing of the 2 Light Attenuation profiles (Linear Attenuation type and Quadratic Attenuation type).
- Here is a screenshot of the Lin/Quad Weighted light with default settings:
- Linear
- This slider/numeric input field, can have a value between 0 and 1. A value of 1 in the Linear field and 0 in the Quad field, in effect means that the light from this source is completely Linear. Meaning that by the number of Blender Units distance specified in the Dist: field, this light sources Intensity will be half the value it was when it reaches the number of Blender Units distance specified in the Dist: field.
- In the situation just described the Linear Falloff type is being completely respected, it has the Intensity value it should have (half Intensity) by the time it reaches the distance specified in the Dist: field.
- When the Quad slider is set to 0 the formula for working out the Attenuation at a particular range for Linear Attenuation is, in effect:
- I = E * (D / (D + Q1 * R))
- Where E is the current Energy slider setting.
- Where D is the current setting of the Dist: field.
- Where Q1 is the current setting of the Linear slider.
- Where R is the distance from the lamp where the light Intensity gets measured.
- Where I is the calculated Intensity of light.
- 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 + Q2 * R2))
- Where E is the current Energy slider setting.
- Where D is the current setting of the Dist: field.
- Where Q2 is the current setting of the Quad slider.
- Where R is the distance from the lamp where the light Intensity gets measured.
- Where I is the calculated Intensity of light.
- 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 + Q1 * R)) * (D2 / (D2 + Q2 * R2))
- Where E is the current Energy slider setting.
- Where D is the current setting of the Dist: field.
- Where Q1 is the current setting of the Linear slider.
- Where Q2 is the current setting of the Quad slider.
- Where R is the distance from the lamp where the light Intensity gets measured.
- Where I is the calculated Intensity of light.
- 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. Then their 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.
- Custom Curve
- The Custom Curve Lamp Falloff type became available in Blender 2.46 and is very flexible.
- 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:
- 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:
- 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:
- Altering the Falloff Curve Profile Graph is easy. Just LMB
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 with slight changes.
- 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. This isn't physically accurate, but can be easier to light with.
- 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.
[edit] Dist: (Distance)
- The Dist: field indicates the number of Blender Units (BU) at which the intensity of the current light source will be half of its Intensity. Objects less than the number of BU away from the lamp will get more light, while Objects further away will receive less light. Certain settings and lamp falloff types affect how the Dist: field is interpreted, meaning that it will not always react the same.
[edit] seperator
- Changing the Dist: field value when using a Spotlight also changes the appearance of the Spotlight as displayed in the 3D Viewport.
- Energy (0.0 - 10.0)
- The Intensity of the light sources illumination.
- Color
- The color of the light sources illumination.
- Sphere
- The Sphere option restricts the lamp's illumination range so that it will instantly stop illuminating past an area once it reaches the number of Blender Units away from itself, as specified in the Dist: field.
- An imaginary Sphere (with a radius of the Dist: field) is placed around the light source and it's light is blocked from passing through the Sphere walls. So the Dist: field now basically means that any light that is further away form its light source than the value in the Dist: field will be Attenuated to 0 after this point, and won't naturally attenuate but instantly stop.
- When the Sphere option is active, a dotted Sphere will appear around the light source, indicating the demarcation point at which this lights propagation will cease, example below:
- Lamp Falloff
- The Lamp Falloff field has been improved in Blender 2.46 so the layout of the Lamp panel is different in a number of ways. One of the changes is the Lamp Falloff drop down menu. The Lamp Falloff types are listed and described below:
- Layer
- Only objects that are on the same layer as the light are lit by the light.
- Negative
- The light takes away light from the surface, subtracting light and making the surface darker, not lighter.
- No Diffuse
- The light does not brighten the color of the surface.
- No Specular
- The light does not cause a shine on the surface, and is not used in calculating the Material Specular color or highlights on the surface.
[edit] Shadow and Spot Panel for Lamp and Sun light sources
When a Lamp or Sun light source are selected the Spot and Shadow Panel has the following default layout:
[edit] Options
- Ray Shadow
- The Ray Shadow button enables the Lamp and Sun light sources to generate Ray Traced Shadows.
- When the Ray Shadow button is selected, another set of options is made available, those options being:
- Shadow Sample Generator Type - Constant QMC
- The Constant QMC method is used to calculate shadow values in a very uniform, evenly distributed way. This method results in very good calculation of shadow value but it is not as fast as using the Adaptive QMC method, however Constant GMC is more accurate.
- Shadow Sample Generator Type - Adaptive QMC
- The Adaptive QMC method is used to calculate shadow values in a slightly less uniform and distributed way. This method results in good calculation of shadow value but not as good as Constant QMC. The advantage of using Adaptive QMC is that it in general is much quicker while being not much worse than Constant QMC in terms of overall results.
- Samples
- This Numerical slider field set the maximum number of samples that both Constant QMC and Adaptive QMC will use to do their shadow calculations. The maximum number of samples that can be taken is 16. According to the tooltip information that appears when over this field the sample value is squared so setting a sample value of 3 really means 32 samples will be taken.
- Soft Size
- The Soft Size numeric slider, determines the size of the fuzzy/diffuse/penumbra area around the edge of a shadow. Soft Size only determines the width of the soft shadow size not how graduated and smooth the shadow is. If you want a wide shadow which is also soft and finely graduated you must also set the number of Samples in the Samples field higher than 1, otherwise this field has no visible effect and the shadows generated will not have a soft edge. The maximum value for Soft Size is 100 (Blender Units?).
- Above is a table of renders with different Soft Size and Sample settings showing the effect of various values on the softness of shadow edges.
- Below is an Animated version of the above table of images showing the effects:
- Threshold
- The Threshold field is used with the Adaptive GMC shadow calculation method. The value in the Threshold field is used to determine if Adaptive GMC shadow sample calculation can skipped based on a threshold of how shadowed an area is already. The maximum Threshold value is 1.
- Only Shadow
- When the Only Shadow button is selected the light source will not illuminate an object but will generate the shadows that would normally appear.
- This feature is often used to control how and where shadows fall by having a light which illuminates but has no shadow, combined with a second light which doesn't illuminate but has Only Shadow enabled, allowing the user to control shadow placement by moving the Shadow Only light around.
[edit] What is Quasi-Monte Carlo?
The Monte Carlo method is a method of taking a series of samples/readings of values (any kind of values, such as light values, color values, reflective states) in or around an area at random, so as to determine the correct actions to take in certain calculations which usually require multiple sample values to determine overall accuracy, of those calculations. The Monte Carlo methods tries to be as random as possible, this can often cause areas that are being sampled to have large irregular gaps in them (places that are not sampled/read), this in turn can cause problems for certain calculations (such as shadow calculation).
The solution to this was the Quasi-Monte Carlo method.
The Quasi-Monte Carlo method is also random, but tries to make sure that the samples/readings it takes are also better distributed (leaving less irregular gaps in its sample areas) and more evenly spread across an area. This has the advantage of sometimes leading to more accurate calculations based on samples/reading.










![[]](/skins/blender/open.png)
