Adding mood with some simple shadowmapping
Shadows can be created artificially, and it is a great way of adding a certain
mood to an otherwise dull picture. Most of the professionals already knows this
fact, and use it with success as well. In the real world art of photography, the
photographer never wants more than one shadow (this is a general rule only, and
general rule have always exceptions). If a photographer made a portrait of a
person and the nose would cast two shadows, he would not be very satisfyed
with the result.
However, there are times when he would want other shadows to be present in the
picture, not generated by the person he/she where to portrait. By using shadow
mapping we can achive these kind of results without even the need of tracing
shadows at all. The correct way of using shadowmapping in Real 3D is to shadowmap
an object that have no other textures at all. Needless to say, most of the time
we do have the need to use textures, so we will have to do things a little bit
different than the 'original' way. By using a black and white (only) image, we
can use the scopemask feature to prevent the normal blending that would occur.
The result will still be blended 50/50 in the 'shadowed' area, but it gives a
nice impression of shadows. For a more accurate result, see
advanced shadowmapping/diffusionmapping. Here is how it can be done:
Create a black and white image
Create a scene with a floor and some object with different textures
Set the camera and lightning
Create a material called 'shadows' with the following attributtes:
- Switch off colormap
- Switch on shadowmap
- Switch on transp. col
- Switch on Scope mask
- We want the white color to be transparent, so set the transp RGB to white
Apply the shadows material above all objects to be affected in the hierarchy
Set the rendermode to shadowless, and render
Note that the black color can be any color to give more a filtering effect. Also
note that this way we can only achive very sharp shadows. Below is an examples of
using shadowmapping in this fashion.
|
|
|
|
| Fig. 1. Shadowless mode
| Fig. 2. Shadowmap added
|
Notice how much more interresting the second picture looks, just by breaking off
some of the main features with with the use of some simple shadowmapping as this.
There are a couple of things worth mentioning about the above pics. First of all,
notice how the shadowmap affect the highly reflective floor. As you can see this
doesn't look very realistic, so be ware of this effect when using shadowmap on
reflective surfaces. Second, I use a little trick well known to photographers;
notice that despite the extreme use of perspective, the parallell vertical lines
are actual parallell. A photographer would probably use a 'shift-objective' (?!?)
to achive this effect (or reduce the effect of angled parallells) but in Real 3D
we have to cheat bigtime. What I do is keep the camera nontilted (angled parallells
occur when the camera is tilted), render an image that is twice as high as it should
be and just crop away the lower part.