Illumination Examples

Paper

It is possible to define custom surface illumination effects by using a Surface illumination shader. The following material; paper, has the property that lighting (including shadows) is visible through the paper (to a certain extent).

The illumination shader computes the product of the dot products <ray*normal> and <lightray*normal>. This product is negative only when the surface is viewed from the opposite side of lighting. The If object notices this and computes illumination in those cases where default shading would leave surface without illumination.

The alternate shading actions are very simple: the lighting intensity is modified by the lighting angle and then reduced by 50 %, because all the light cannot penetrate the paper.

Example file: tutorprojects/material/vsl/paper

Fur

This example material simulates a surface covered by dense, short fur that shines in light.

  • The Surface properties shader includes only one object, which adds a low amount of diffuse color by scaling down the furcolor value defined in the Material Initialization shader.

  • The actual trick is made in the Surface illumination shader: illumination is defined so that it reaches the maximum value when the small hairs are viewed from the side. This behavior is quite different from the usual diffuse shading.

  • The If object tests, that light does not get through the surface.

  • The two curve objects define the amount of illumination; by modifying these curves, surface appearance can be adjusted.

Example file: tutorprojects/material/vsl/shinyfurExample file: tutorprojects/material/vsl/silk

Matte shadows

In the Surface illumination shader, both the original light properties of a light source and the amount of light reaching the examined surface point are available. It is possible to compare these two channels for creating advanced matte effects. In the example below, a photographed backdrop is not illuminated by the light sources (the photograph already includes illumination), but 3D objects still cast shadows on it.

1. Create the following VSL material:

2. Create a camera object using the camera tool.

3. Create a backdrop object using the backdrop tool. Use the material defined above.

4. Put some objects in front of the backdrop, and some light sources behind objects, so that objects cast shadows to the backdrop.

5. Take the camera view (View's popup Camera/Object View) and render.

Some notes:


Example file: tutorprojects/material/vsl/matteshadows
Example file: tutorprojects/material/vsl/alphashadows

Slide projector

1. Create a light source.

2. Then apply the following material to it (for example using a parallel mapping):

Example file: tutorprojects/material/vsl/slideprojector

[Note] Note
The mapped material defines light properties in the examined illuminated surface point, not on the surface of the mapping object. This means that the parallel projection used in the example above works best with a distant light source, because both project their influence in a similar way. A pyramid mapping matches with a point light source.

Custom light falloff rate

This example is recommended for those users who are familiar with polar space coordinates.

1. Create a point light source.

2. Then apply the following material to it using a spherical mapping. The origin point of the mapping should match the position of the light source.

Example file: tutorprojects/material/vsl/curvelight

Gamma ray light sources

This example shows how to create a light source that casts special kind of light that illuminates only certain kind of objects.

1. Create a new channel of type Float using the New popup menu of the Channels tab of the select window. Rename it as gamma.

2. Create a light source and map the material of the upper image to it.

If object tests if the gamma channel value is inside 0.01 and 1

3. Create an object and map the material shown in the lower image to it (any mapping type is suitable):

Only objects with gamma material become illuminated by gamma light.

Example file: tutorprojects/material/vsl/gammalight

The Constant object assigns a value between 0.01 and 1 to the gamma channel

Reflective in light

Light can define surface properties. For example, a light source can act as an X-ray radiator, which makes objects transparent. Or, like the example below shows, lighting can control the reflectivity of a surface.

Lightbuffer is a user defined color channel. The amount of light arriving from light sources is summed into it.

In the Secondary ray shader, the illumination of the traced reflection ray is scaled by the total sum of light.

Example file: tutorprojects/material/vsl/lightmakesreflective