DirectX, and shadows

Started by
1 comment, last by MJP 15 years, 9 months ago
Howcome alot of games don't use .x files but use DirectX. Are there books for DirectX 9.0 that come with a cd and a working and nice looking 3d level with great lighting and shadows. Never figured out how to do shadows thus posting in the beginner's section about how to do shadows for characters walking around a level. Read some tutorials about shadows but they did not help at all.
Advertisement
Did you actually try to implement the shadows as per the tutorials you've read?

It is actually very easy to implement basic shadow mapping; first, I recommend that you just project a black blob texture to your scene by using a matrix representing the view from the lamp, then improve it by replacing the black blob with black image of your shadow caster.

The final, most difficult phase is to project the depth values from your lamp to the scene and compare the depths to determine the correct shadow extents. However, very basic shadowing (no self-shadows, potential shadow between lamp and shadow caster) can be implemented without this step.

Niko Suni

Games don't use .X files because they usually come up with a custom format that's suited to the engine their using. .X files are pretty generic and only support a limited feature set: for example, it would be difficult or impossible to integrate say physics information into the stored model.

As for shadows...these days shadow maps are pretty much the de-facto solution. There's a sample in the SDK that can get you started.

This topic is closed to new replies.

Advertisement