|
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 |
![]() |
This example material simulates a surface covered by dense, short fur that shines in light.
|
![]() |
Example file: tutorprojects/material/vsl/shinyfurExample file: tutorprojects/material/vsl/silk
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.
|
![]() |
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:
In the Surface properties shader, the color of the backdrop is assigned directly to the illumination channel. The result will show the color in its unmodified state. Diffuse color is set to black to eliminate other shading effects.
The Surface illumination shader first computes the amount of shadow. Negative values are truncated to zero, and the Surface:Illumination channel is scaled by the resulting factor.
This example shows a situation where the backdrop image is in a digital form. We could also store the amount of shadow into the alpha channel. This would allow generation of shadows later to any background video sequence. It is also possible to map reflecting color to the areas where the backdrop image is supposed to reflect the environment and so on - the possibilities are endless.
Example file: tutorprojects/material/vsl/matteshadows
Example file: tutorprojects/material/vsl/alphashadows
Slide projector1. 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 |
|---|---|
| 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. |
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. |
![]() |
The three curves of the curve shader control the light falloff with respect to polar coordinates. In other words, it is possible to draw the shape of the light beam created by the light source:
The red curve controls the first polar parameter, heading. This may be constant in which case the light distribution is symmetric. By making peaks to it, light source may send more light up, to the left, etc.
The green curve controls the pitching parameter. Zero pitching corresponds the direction of the spot axis, a pitching of 0.5 is 180 degrees from the axis. Curve values greater than 0.5 control directions behind the light source. For example: if the green curve has a high value in the beginning, the spotlight will have high intensity in the middle. By changing this parameter, it is possible to make the light source cast a light ring, for example.
The blue curve is perhaps the most useful one: it defines the falloff by distance. Usually this curve decreases down to zero. The size of the sphere mapping defines the corresponding area in space. By resizing it, it is possible to adjust the area of influence of the light source.
A more intuitive way to control the shape of a light beam is based on a slide projector idea. Draw two gray scale images, which show the shape and falloff of the light beam. Then map them to the light source from the side and from the top using a parallel mapping.
Example file: tutorprojects/material/vsl/curvelight
|
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. |
![]() |
|
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 |
![]() |
|
![]() |
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