Realistic Spotlights for Blender & Cycles

Software:
Blender 2.79 | Cycles Renderer

There’s currently no built-in support for IES light sources in Blender & Cycles.
We already know that Blender 2.8 will have the feature built into it (which is great news!), and there’s an addon that provides the functionality, but I wasn’t satisfied with it’s workflow, not being integrated well into Cycles.
So I decided to develop a custom Cycles shader (node group) that will provide realistic IES like spotlights in a convenient customizable way.

The Shader I developed is called CG-Lion Spotlight Presets Pack 1.0 and is available for purchase on Blender Market.
It doesn’t load external IES files, but instead has a pre-configured library of 20 spotlights shapes, and also provides features that are not available in IES lighting like tweaking the spotlight beam focus, adding a chromatic dolor dispersion effect, and producing a correctly bright surface at the light source.

CGL_Spotlight_Presets_Pack_1.0_Previews.jpg

This slideshow requires JavaScript.

Related:
Customizable Photo-realistic Car-paint shader for Cycles
Complex Fresnel texture for Cycles

Advertisements

Cycles Light (Shadow) Sampling

Software:
Blender 2.79

By default, in Path Tracing Integrator Mode, Cycles traces one ray randomly between all lights (per each camera – AA sample).
So if some lights in the scene are more important than others this will cause inefficient light sampling.
* Especially if there are a few important lights and many unimportant ones.

Light sampling can be set per light by switching the Integrator Mode to Branched Path Tracing, making sure Sample All Direct Lights is checked, and the setting the number of samples per light in the light parameters.
* The option to set the number of samples at the light parameters is only available in Branched Path Tracing Mode.

Untitled-2

In the example below there are 3 lights.
The light on the right has 64 a samples per AA sample, while the 2 other lights have just 1 sample.

Untitled-1.jpg

More on Cycles sampling:
https://docs.blender.org/manual/en/dev/render/cycles/settings/scene/render/integrator.html#sampling

Cycles Area Light pleasant surprise

Software:
Blender 2.79

One of the features I would really like added to the Cycles Renderer is a photo-metric workflow.
That is the ability to set light sources intensity using real-world photo-metric units, load IES photo-metric data, have a physical daylight system, and set photographic camera exposure and white-balance for the output image.

While Cycles currently doesn’t have a fully functional photo-metric workflow,
It is equipped with some important basic ingredients needed for the development of such a workflow.

One Of these features is the Black-Body color conversion node that allows specifying color by Kelvin color temperature,
Another is the procedural Sky texture featuring Hosek / Wilkie and Preetham physical sky models, that can also be controlled according to global position, date and time with this addon.

Recently I’ve had a pleasant surprize finding out that Cycles actually has another important feature for a photometric workflow, and that is that Cycles Area Lights maintain a fixed general light output (‘Luminous Flux’) while area is changed and changes specular intensity correctly to so that the smaller the light source area, the greater its brightness (as it should physically be).
* This in difference to the way a mesh light with an emission shader behaves where the light output is per area and therefore increases or decreases when changing the shape and size of the surface.

This makes designing light sources with a fixed total output of light yet different shape, and therefore different specular reflection, shading, shadow softness possible,
And is in itself a valuable feature in realistic light source design.
* Especially coupled with setting the light color using Kelvin color temperature (Black-body node)
The only thing missing is the an ability to specify the total output of the light source in Lumens (lm) units.

I have encountered a mentioning of Cycles having a physical scale conversion ratio here:

http://www.3d-wolf.com/camera.html

Marco Pavanello, the developer of the Blender ‘Real Camera Addon‘ wrote:
“In Blender the Emission Node Strength is measured in W/m^2”
I haven’t had the time yet to seriously find out how that should be translated to intensity in lumens..
* It  should be noted that both the Cycles Area light and mesh light use the Emission shader as there source for intensity / color settings, but differently,
You can see in the demonstrations below that for a light source of the same surface area a significantly larger strength value is needed to produce roughly the same light output as the light mesh and this is probably due to the output being internally divided by surface area which is in fact the subject of this post.

Here are some renders to illustrate the point, and the diffrent behavior of light mesh (mesh with an Emission shader)
I’ve added a rough glare effect that depends on float color intensity to illustrate the way the specular highlight intensity increases as the area of the ligt source gets smaller while overall light output is the same:

AREA_Sizes
Cycles Area Light with different sizes but same strength
MESH_Sizes
Cycles Mesh Light using an Emission Shader with different sizes but same strength

MESH_Sizes_Compensation

Cycles Mesh Light using an Emission Shader with different sizes and strength changes to compensate