Graphics Reference
In-Depth Information
Using a shadow map for fixed shadows
In Chapter 5 , Lights and Custom Shaders we will show you a number of recipes that
deal with lights and shadows. It is, however, also possible to fake shadows using a
texture. This kind of texture is called a shadow map or a light map. In this recipe, we
explain how you can use such a texture in Three.js.
Getting ready
For this recipe, we first need a shadow map. There are different ways to create shad-
ow maps, but that is outside the scope of this recipe. If you're interested in creat-
ing your own shadow maps, you can follow this tutorial from the Blender site: ht-
tp://wiki.blender.org/index.php/Doc:2.4/Tutorials/Game_Engine/YoFrankie/Bak-
ing_Shadow_Maps .
In the sources for this topic, in the assets/textures folder, you can find a
shadow-map.png file that we'll use in this recipe.
Search WWH ::




Custom Search