Difference between revisions of "Lighting"

From LuxCoreRender Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 2: Line 2:
===Area Lights and Mesh Lights===  
===Area Lights and Mesh Lights===  


The most common way of lighting in LuxCoreRender is by using area lights. With this light you are able to simulate a wide range of lighting. It supports common settings such as power and color but also spread angle, opacity and laser.  
The most common way of lighting in LuxCoreRender is by using area lights. With this light you are able to simulate a wide range of lighting. It supports common settings such as power and color but also allows to control the spread angle, as well as the shape of the emitted light using IES files.


Another common way is by using mesh lights. This type of light supports the same features as area lights, except laser, but also features textured lighting. As mesh lights are objects, you can assign an entire object to emit light, such as the tungsten filament in a light bulb or halogen bulb. In general, it's advised to use mesh lights with as few faces as possible to keep render times down.
Another common way is by using mesh lights. This type of light supports the same features as area lights but also features textured lighting. As mesh lights are objects, you can assign an entire object to emit light, such as the tungsten filament in a light bulb or halogen bulb. In general, it's advised to use mesh lights with as few faces as possible to keep render times down.


Objects only emit light in the direction that the normals of the object's faces are pointing.
Objects only emit light in the direction that the normals of the object's faces are pointing.


In most cases, it's recommended to use only mesh/area lights and environmental lighting for your scene, rather than point or spot lights. This is because the point and spot lights have no real world equivalent as the light source is an infinitely small point. As a result, they tend to produce unnaturally hard lighting and sharp shadows.  
===Environment Lighting===
[[file:Lighting_environment_light.jpg|left|thumb|250px|Mirror material lit by a hemi lamp]]
Environment lighting encloses the scene entirely, lighting it from all angles. It is normally used for environment mapping, although it can also be used to add a solid color environment. The hemi lamp is used for this type of lighting and it accepts latlong environment maps.


===Point Lights===
Environment lighting is usually done with HDR(high dynamic range) images but it is possible to use low dynamic range images (like JPG or PNG) as well, but in this case you may want to add some additional lighting to your scene to avoid getting a poorly contrast render. This is not necessary with HDR environment maps, which can be used as the only source of light to create a realistic lighting. Note that the hemi lamp's location in the scene does not matter, only its rotation.
Point lights are infinitely small light sources that emit light in all directions. Apart from their location, the only available setting is ''color'', which can also be used to regulate intensity.


===Spot Lights===
<!--When using environment maps, using a gamma value of 1.0 (instead of the usual 2.2) is recommended. The exception to this is if you want the environment to look exactly like the map itself did in your image editor. This is probably not the case if you are using an actual HDR map.
Spot lights are infinitely small lights that emit light in a cone shape. Apart from color and location, the width of the cone can be set (as the number of degrees of the center line it will extend), and there is a setting to feather the intensity towards the edge.
-->
The [[External Resources|External Resources]] page has some links to sites that offer free and quality HDR's. Also a simple web search for "hdri maps" or "hdr maps" will give a lot of results. You can also create your own hdri maps with LuxCoreRender by using the [[LuxCoreRender_Cameras|environment/panorama camera.]]


'''Projector'''
For more information on environment mapping, see the [[Environment_map|Environment map]] page
Both point lights and spot lights can distribute their light and color according to an image. With spot lights, this results in an effect like something being projected from a diapositive projector or beamer. With point lights, the image map is spherically mapped.    <--  check if this works in luxcore
<br clear="all"/>


[[Image:Projector.jpg|frame|left|a room lit by a single projector]]<br clear="all" />
===Sun and Sky===


[[Image:Lights-01.jpg|frame|left|An example of point (left) spot (center) and area (right) light types]]
<br clear="all" />
===Sun and Sky===
The sun and sky light creates a lighting setup that simulates the light of the sun and atmosphere, based on the direction of a sun light in the scene and a parameter named ''turbidity'' which defines the clearness of the sky. Both the sun angle and the sky clearness influence the color of the light.
The sun and sky light creates a lighting setup that simulates the light of the sun and atmosphere, based on the direction of a sun light in the scene and a parameter named ''turbidity'' which defines the clearness of the sky. Both the sun angle and the sky clearness influence the color of the light.


[[Image:Sunsky.png|frame|left|various sun angles result in different sky and light colors ]]
Note that the sun lamp is very bright (as it is in real life) so you may have to turn the Gain way down if you have other lights in the scene. The other lights may look like they are not even emitting, but they are actually overpowered by the sun. It is possible to use this light with sun only, sky only, or the default sun+sky. If you want softer shadows try adjusting the relative sun size parameter.<br/>
<br clear="all" />
Note that the sun lamp's location in the scene does not matter, only its rotation.


[[Image:Turbiditysettings.jpg|frame|left|turbidity settings of 2, 4, 8 and 16, influencing both sky clarity and color]]<br clear="all" />
<gallery mode="nolines" widths=250 heights=250>
The intensity of the light can be set with the ''gain'' parameter. This can be useful in scenes where a physical sky is combined with emitter lights. If you want softer shadows try adjusting the relative sun size parameter.<br clear="all" />
Lighting_sun_angle_1.jpg|Sun lamp angle 1
Lighting_sun_angle_2.jpg|Sun lamp angle 2
Lighting_sun_angle_2_+_higher_turbidity.jpg|Sun lamp angle 2 and higher turbidity


It is possible to use this light with only the sky, or only the sun. The former can be useful to light a scene at night. (Note that the night sky itself will not be very realistic looking, as it will lack both clouds and stars, but it should give convincing illumination to the scene) Sun only is useful for some sci-fi scenes which may not take place on planet Earth, although often the distant light is preferable in this case. (see [[LuxRender_Lighting#Distant |below]].)
</gallery>


===Infinite (Environment Maps)===
===Point Lights===
The infinite light encloses the scene entirely, lighting it all angles. It is normally used for environment mapping, although it can also be used to add a solid color environment.
Point lights are infinitely small light sources that emit light in all directions. In most cases, it's recommended to use only mesh/area lights and environmental lighting for your scene, rather than point or spot lights. This is because the point and spot lights have no real world equivalent as the light source is an infinitely small point. As a result, they tend to produce unnaturally hard lighting and sharp shadows.  


Environment maps are high dynamic range images that function as a light source. The maps are projected around the scene and emit light; the colour and intensity of the light depend on the local colour of the map. LuxRender accepts both latlong and angular (light probe) environment maps.


When using environment maps, using a gamma value of 1.0 (instead of the usual 2.2) is recommended. The exception to this is if you want the environment to look exactly like the map itself did in your image editor. This is probably not the case if you are using an actual HDR map.
===Spot Lights===
Spot lights are infinitely small lights that emit light in a cone shape. Apart from color and location, the width of the cone can be set (as the number of degrees of the center line it will extend), and there is a setting to feather the intensity towards the edge.


It is possible to use low dynamic range images (like JPG or PNG) as environment maps, but in this case you may want to add some additional lighting to your scene to avoid getting a poorly contrast render. This is not necessary with HDR environment maps, which can be used as the only source of light to create a realistic lighting.
As with the point lights, it's recommended to use only mesh/area lights and environmental lighting. This is because the point and spot lights have no real world equivalent as the light source is an infinitely small point.  


You can find a lot of free quality HDR maps on the web by looking for "hdr maps"/"hdri maps" or "light probes".


For more information on environment mapping, see the [[Environment_map|Environment map]] page
'''Projector'''
 
It is also possible to use the infinite light without any sort of environment map to achieve an even-colored world. If you do not have a fully enclosed scene, and don't plan to use sunsky, it is generally a good idea to add a blank infinite light so that there is something to see in reflections.
 
If you are using the distant light or sun without sky, the infinite light can be useful for adding in a sky, with or without an environment map.
 
 
[[Image:Lightingtypes.jpg|frame|left|lighting using HDRI maps (left two images), a physical sky and an infinite environment (right). HDRI maps by Doug Hammond]]<br clear="all" />


Both point lights and spot lights can distribute their light and color according to an image. With spot lights, this results in an effect like something being projected from a diapositive projector or beamer. With point lights, the image map is spherically mapped.    <--  check if this works in luxcore




===IES data===
===IES data===
IES files contain information about the light distribution of a lighting fixture. These files are typically provided by lighting fixture manufacturers.
With the help of IES files you can get the light distribution pattern of a real light fixture. This will keep render times down as you don't need a reflector or glass material to replicate the pattern. The renders below were lit with the same area light, only with different IES files. Area lights, spot and point lights supports IES files. Some links to available IES files can be found on the [[External Resources#IES lighting files|external resources page]] and more information about IES files and how to create your own can be found here: [[Lighting_With_IES_Files]]
 
[[Image:IES_examples.jpg|frame|left|a number of IES data files]]
 
<br clear="all" />


The main use of IES is measuring real world lamp models, many manufacturers sites offer their IES library for free. Generic IES can also be made with applications like "ies generator". Since IES profiles can be applied to meshlights and arealights, they can be used to control the light spread angle, much like a spotlight cone. Arealights with the IES profile of a spot will illuminate like a spot  but will have a physical size. This will make them easier to balance in intensity with other physical lights.
<gallery mode="nolines" widths=200px heights=200px>
However, to have the physical intensity of a specific ies scaled correctly the ies must be used with pointlights (mesh and planes will still make the correct 'shape' , but the intensity will be altered by their power, efficiency and  size)
Lighting_IES_example_1.jpg
Lighting_IES_example_4.jpg
Lighting_IES_example_2.jpg
Lighting_IES_example_3.jpg


 
</gallery>
[[Image:Lightcones2.JPG]]
 
On the left: a single quad meshlight using a "narrow cone" IES : resulting light (from a cylinder) makes "petals" as if the sides were separate
spotlights, on the right: a "wide cone" IES makes almost a uniform ring shape.
 
And these are the corresponding IES diagrams:
 
[[Image:Iescones.jpg]]
 
These simple shapes make light "cones", complex shape make various effects (wallwashers , multiple beams..) The diagram: what you see in IES viewers or iesgen4 reads like this: in the center there is the light source. Around it, infinite rays going in every direction (generally represented in 2d, the 3d shape is obtained by visualizing the spinning of the 2D graph around a line in the plane)
 
Each ray represents the light going out of the lamp in a particular direction (towards the floor, walls, ceiling). The length of the ray is the intensity of light in that direction. The shape you see is made by the tips of all rays.
 
A circle means intensity is the same in all directions, a thin and tall ellipse means a narrow light cone going downwards (or up). Intensity scale (units): the intensity at all directions affects the overall brightness of the lamp; a light sending rays of maximum intensity (1.0) on a small angle (like a ellipse diagram) will be dimmer than a light with intensity 1.0 in all directions (a circle diagram).
Most ies files have a 2D diagram meaning that the light distribution is symmetric all around the lamp axis. Some files have 3d diagram, made by two sections (the 2nd also made on the lamp axis but rotated 90°) they're visible in iesviewer in red and pink. For placing these asymmetric lights in your scene, rotation on vertical axis counts.
 
 
There is unfortunately no standard for intensity. It can mean that of a specific bulb (i.e. 40W), a generic power (i.e. 100W and you have to use "gain" in the exporter as multiplier to adjust it). Or in generic IES files can have intensity 1.0 and "gain" is used to specify their power (IES suppliers specify what rule they used on their site or documentation).
 
Diagram types: that above is a "polar" visualization of the IES with the rays drawn around the center (used in iesviewer and iesgen4) it's the easier to read as it resembles the actual shape of the light. The other possible visualization is a Cartesian (XY) diagram, as used by iesgen3, shows ray intensity on Y and the direction on the X axis (on the left it's intensity in the center of the cone (the light axis), on the right the intensity perpendicular to that ) this is less intuitive but makes easier to draw simpler curves for generic IES.
 
[[Image:Iesgen3penumbra.jpg]]
 
Top: the same "narrow cone" ies as before seen in iesgen 3 (xy diagram)
Bottom: an IES with similar cone angle but "sharper" (smaller penumbra angle)
 
LuxRender can also use IES files with both vertical and horizontal angle data.
 
[[File:3D_IES_13Oct2013.jpg|400px|thumb|left|IES light with both vertical and horizontal data.]]


<br clear="all" />
<br clear="all" />


IES files can also be generated by hand, as the 3D IES file used in the image above was generated by hand. A good place to start is to open an existing IES file and start modifying it. You can find standard IES file format specifications by doing a quick internet search.
<!--
 
===Color and Spectrum===
Useful links (freeware, for windows , working in wine)
LuxRender calculates light colors using actual spectral data (is that true for luxcore too? ). When using an RGB color as input, LuxRender will generate a physically plausible spectrum based on the desired color. The implementation is based on a [http://www.cs.utah.edu/~bes/papers/color/ paper by Brian Smits].
[http://www.tom-schuelke.com/ies-gen3.exe]
[http://rip3d.net/Downloadmodels/iesgen_4.rar]
[http://www.rip3d.net/web/en.html#/free/downloads]
[http://www.cgarena.com/freestuff/tutorials/max/ieslights/IESviewerSetup.rar]
[http://www.lithonia.com/Photometrics.aspx]
 
Some links to IES data files can be find on our [http://www.luxrender.net/wiki/External_resources#IES_lighting_files external resources] page.
 


However, you can also define a spectrum for the light source in a variety of ways, using spectrum textures. For more information, see [[LuxCoreRender Textures Spectrum]]


===Colour and Spectrum===
-->
LuxRender calculates light colors using actual spectral data. When using an RGB colour as input, LuxRender will generate a physically plausible spectrum based on the desired colour. The implementation is based on a [http://www.cs.utah.edu/~bes/papers/color/ paper by Brian Smits].


However, you can also define a spectrum for the light source in a variety of ways, using spectrum textures. For more information, see [[LuxRender Textures Spectrum]]
[[LuxCoreRender User%27s Manual|Back to LuxCoreRender User's Manual]]

Latest revision as of 11:13, 15 April 2018

Area Lights and Mesh Lights

The most common way of lighting in LuxCoreRender is by using area lights. With this light you are able to simulate a wide range of lighting. It supports common settings such as power and color but also allows to control the spread angle, as well as the shape of the emitted light using IES files.

Another common way is by using mesh lights. This type of light supports the same features as area lights but also features textured lighting. As mesh lights are objects, you can assign an entire object to emit light, such as the tungsten filament in a light bulb or halogen bulb. In general, it's advised to use mesh lights with as few faces as possible to keep render times down.

Objects only emit light in the direction that the normals of the object's faces are pointing.

Environment Lighting

Mirror material lit by a hemi lamp

Environment lighting encloses the scene entirely, lighting it from all angles. It is normally used for environment mapping, although it can also be used to add a solid color environment. The hemi lamp is used for this type of lighting and it accepts latlong environment maps.

Environment lighting is usually done with HDR(high dynamic range) images but it is possible to use low dynamic range images (like JPG or PNG) as well, but in this case you may want to add some additional lighting to your scene to avoid getting a poorly contrast render. This is not necessary with HDR environment maps, which can be used as the only source of light to create a realistic lighting. Note that the hemi lamp's location in the scene does not matter, only its rotation.

The External Resources page has some links to sites that offer free and quality HDR's. Also a simple web search for "hdri maps" or "hdr maps" will give a lot of results. You can also create your own hdri maps with LuxCoreRender by using the environment/panorama camera.

For more information on environment mapping, see the Environment map page

Sun and Sky

The sun and sky light creates a lighting setup that simulates the light of the sun and atmosphere, based on the direction of a sun light in the scene and a parameter named turbidity which defines the clearness of the sky. Both the sun angle and the sky clearness influence the color of the light.

Note that the sun lamp is very bright (as it is in real life) so you may have to turn the Gain way down if you have other lights in the scene. The other lights may look like they are not even emitting, but they are actually overpowered by the sun. It is possible to use this light with sun only, sky only, or the default sun+sky. If you want softer shadows try adjusting the relative sun size parameter.
Note that the sun lamp's location in the scene does not matter, only its rotation.

Point Lights

Point lights are infinitely small light sources that emit light in all directions. In most cases, it's recommended to use only mesh/area lights and environmental lighting for your scene, rather than point or spot lights. This is because the point and spot lights have no real world equivalent as the light source is an infinitely small point. As a result, they tend to produce unnaturally hard lighting and sharp shadows.


Spot Lights

Spot lights are infinitely small lights that emit light in a cone shape. Apart from color and location, the width of the cone can be set (as the number of degrees of the center line it will extend), and there is a setting to feather the intensity towards the edge.

As with the point lights, it's recommended to use only mesh/area lights and environmental lighting. This is because the point and spot lights have no real world equivalent as the light source is an infinitely small point.


Projector

Both point lights and spot lights can distribute their light and color according to an image. With spot lights, this results in an effect like something being projected from a diapositive projector or beamer. With point lights, the image map is spherically mapped. <-- check if this works in luxcore


IES data

With the help of IES files you can get the light distribution pattern of a real light fixture. This will keep render times down as you don't need a reflector or glass material to replicate the pattern. The renders below were lit with the same area light, only with different IES files. Area lights, spot and point lights supports IES files. Some links to available IES files can be found on the external resources page and more information about IES files and how to create your own can be found here: Lighting_With_IES_Files



Back to LuxCoreRender User's Manual