Static shadows for everything! A workshop by Christian Behrenberg
=================================================================

The Acknex 5 engine allows realtime shadows for *.mdl entities and static shadows for normal blocks. A lot of users want new features, in this case e.g. better realtime shadows or those in lower editions. My workshop will explain the method you must use to create high detailed shadows for your polygonal entities. The requirements are only an edition of A5 and its newest update, your favorite MDL and a good nose for WED.


Chapter 1  Used for...
-----------------------

At first I must describe the goal we want to reach. There are two different types of shadows. One type is the usual one, which everyone know if he has got experience with WED. Build your level, but lights inside and your level is shaded. The other type of shadow is the realtime-shadow, but they are only avaible for Commercial and Pro- users.

(see "picture_1.jpg")

To provide the users of standard- and extra-edition the possibility of shadows for entities I will explain how to do this. But be prepared! This workshop does only explain how to create static shadows for STATIC models. That means that if you move the model, the shadow doesnt. Skin-animation is possible of course, but animation possible, but not good, because the shadow doesnt move. The shadow consists of lightmaps which will be generated by the map-compiler, so its very interesting that those static shadows are effecting on the whole level.


Chapter 2  The model...
------------------------

In the progress of this workshop we will use an abstraction of the model. That means: if you want a static shadow e.g. for your very detailed model of a statue with its very detailed parts like the face and so on, you will see not a shadow with that detailness. Here a sample pic of an AT-AT and its static shadow on some architecture used for this example:

(see "picture_2.jpg")

You can see, that the shape of the shadow is equal to the model and its form. There are other methods on the road how to fake static and realtime-shadows, e.g. with transparent sprites. But those are only working if the complete surface of the shadow lays on plain blocks. If the players stays beside an edge and the sprite is bigger than the distance to the edge from the player, the sprites hangs in the air. Thats not realistic. My method for static shadows works hand in hand with the map-compiler, so every block gets an individual lightmap. Thats good, if you use complex architecture.


Chapter 3  Create the shadow... eh?
--------------------------------------

Yes, YOU must create the source the compiler needs to generate the lightmaps for your model. Eh? Okay, I will explain. How do you create shadows in your level with WED? Place blocks, one or more lights and compile it. How do you create shadows FOR YOUR ENTITY in your level with WED? Place blocks AND YOUR MODEL, one or more lights and compile it. Thats it. As I said, we will use an abstraction of our model in WED. That means, that you will place the model in your enviroment and then build up blocks which are similar to a simple version of the model-shape.

(see "picture_3.jpg")


Chapter 4  How to simplify...
------------------------------

Details. A keyword, but not for us.
As I said we will simplify the shape of the model to build up blocks which cause the shadow. However, the best method is this: after placing the model, you zoom-in in WED and then you place blocks along the shape. But use the primitives, its easier for the compiler to work with it, your build-time is shorter, your work is more less and the user doesnt recognize details which arent there. Or do you miss on the first look the details on the feet of the AT-AT?

(see "picture_4.jpg")

I do not so. Thus, you must decide between detailed and useful shapes. Thats the way it works.


Chapter 5  Magic moments...
----------------------------

So, you built up your blocks and now? Mh.. There are some other things to do for your *perfect* shadow. Get into the settings tab of that texture you decided for your shapeblocks. Set Smooth to -false- and None to -true-. Then click the Cancel-button and enter the properties-tab of your model. Now do this: At first enable Unlit and set Ambient to a good value, e.g. 85. Its because the blocks will darken the model, and that isnt desired. The blocks will do collision detection, so turn on the passable-flag to prevent bounding-box collision detection. Another thing to do: turn on the passable-flag of your blocks, if you wish, that the player can pass it; a good example is a water-fountain. That isnt usual, so do this not, if you arent sure.


Chapter 6  The bad side...
---------------------------

The shadow of the AT-AT model is pretty nice and there arent errors. But sometimes you get them, though they do not, if you are using simple architecture. Do not create weird block-creations! Do not use CSG-subtract! Do it on your own! Errors are for example endless shadows (difficult to explain) or other weird things. Though, I must mention some other information. First: Be sure, that the model covers those surfaces, where the shadow-blocks are touching the real ones. Otherwise you get graphical errors (not in Preview mode, only in Run mode). Second: I declared, that animation isnt that good for models with attached static-shadows, because the shadow doesnt change. But if the animation is calmed, you can use animation as well, for example a tree-mdl with its static shadow and flattering leaves (calm atmosphere!).


Chapter 7  good morning, good evening and good night...
--------------------------------------------------------

Thats all. I hope, that you enjoyed this workshop and that you will do better artwork in your upcoming game. Thanks to Marco Grubert for his information about the compiler and to all the other Community members.

If you have got information, questions, critiques or other subjects you wanna ask me, dont hesitate to mail me to heelx_@web.de

Christian Behrenberg, June 2002
