![]() |
|||||
|
|
VOLUMETRIC SHADOWS
Any 3d model made of just closed hulls can be used as a shadow caster by
3Impact engine. Shadow casters aren't directly rendered. Instead, the engine
will render the shadow they cast onto visible meshes. ![]() Make sure that the model: 2. Save the shadow model to 'mygame_res' folder as an .x file, named, for example, 'mymodel_shadow.x'. NOTE: make sure that DirectX® templates and material data are actually exported to the destination .x file. 3. Open your compiler and, in the source code for the interactive-ball game, replace the "default_res\\ball_shadow.x" string in the iMeshBodyShadowCasterCreate() function call with "mygame_res\\mymodel_shadow.x" and then re-compile and run. For example, you may want to model it as a subset of the visible mesh, in order to reduce the number of shadow-polygons to render. However, because the shadow is cast onto the corresponding visible mesh too (self-shadow-casting), exactly matching the geometries will ensure a consistent effect. ![]() When a caster mesh is provided for both the ball and the wall (left), the visual effect is always proper. But when a caster isn't provided for the wall (right), chances are that the ball shadow is also cast on the dark side of a the wall. It also isn't properly cast onto the ground either. Still, in order to ensure smooth frame rates on slower machines, not to provide, whenever possible, a shadow caster for scenery features that are static is recommended. You should design your scenery models so that the number of static features casting shadows is minimal. You should provide a different shadow caster for each scenery feature so that you can disable them when far from the camera. You should even consider faking some static shadows by painting shadows in your scenery textures. |
||||
![]() |
|||||