07.01.2013 Views

3D graphics eBook - Course Materials Repository

3D graphics eBook - Course Materials Repository

3D graphics eBook - Course Materials Repository

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Self-shadowing 177<br />

Self-shadowing<br />

Self-Shadowing is a computer <strong>graphics</strong> lighting effect, used in <strong>3D</strong><br />

rendering applications such as computer animation and video games.<br />

Self-shadowing allows non-static objects in the environment, such as<br />

game characters and interactive objects (buckets, chairs, etc), to cast<br />

shadows on themselves and each other. For example, without<br />

self-shadowing, if a character puts his or her right arm over the left, the<br />

right arm will not cast a shadow over the left arm. If that same<br />

character places a hand over a ball, that hand will not cast a shadow<br />

over the ball.<br />

Shadow mapping<br />

Shadow mapping or projective shadowing is a process by which<br />

shadows are added to <strong>3D</strong> computer <strong>graphics</strong>. This concept was<br />

introduced by Lance Williams in 1978, in a paper entitled "Casting<br />

curved shadows on curved surfaces". Since then, it has been used both<br />

in pre-rendered scenes and realtime scenes in many console and PC<br />

games.<br />

Shadows are created by testing whether a pixel is visible from the light<br />

source, by comparing it to a z-buffer or depth image of the light<br />

source's view, stored in the form of a texture.<br />

Principle of a shadow and a shadow map<br />

If you looked out from a source of light, all of the objects you can see<br />

would appear in light. Anything behind those objects, however, would<br />

be in shadow. This is the basic principle used to create a shadow map.<br />

The light's view is rendered, storing the depth of every surface it sees<br />

(the shadow map). Next, the regular scene is rendered comparing the<br />

depth of every point drawn (as if it were being seen by the light, rather<br />

than the eye) to this depth map.<br />

This technique is less accurate than shadow volumes, but the shadow<br />

map can be a faster alternative depending on how much fill time is<br />

required for either technique in a particular application and therefore<br />

may be more suitable to real time applications. In addition, shadow<br />

Doom 3's unified lighting and shadowing allows<br />

for self-shadowing via shadow volumes<br />

Scene with shadow mapping<br />

Scene with no shadows<br />

maps do not require the use of an additional stencil buffer, and can be modified to produce shadows with a soft edge.<br />

Unlike shadow volumes, however, the accuracy of a shadow map is limited by its resolution.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!