Shadow is a plugin to create realistic shadows for billboard trees.
When you create trees using planar geometry, they cast ugly rectangular shadows. You must use Raytrace Shadows to get a good projection, but it's very slow. This plugin builds a perfect shadow for Forest objects in all conditions. It works as a Shadow Map and there are no problems at render time:
This is a shadow plugin, and must be chosen in the shadow parameters of each light. At present, it only works with directional lights (with spots and omnis it doesn't create any shadows for trees):
XShadow uses two opacity textures to build the shadow: one vertical and the other horizontal.
By default, the plugin searches automatically in the material tree to find the vertical texture (Standard, Multi Sub-Object and "Forest Material" only). The horizontal texture must be defined in a "Forest Material" (see Forest Material reference for details).
These parameters define the vertical texture in the XShadow plugin:
Builds the rectangular original shadow (from Forest mesh)
Use the opacity texture applied for each tree as shadow.
Lets you choose a custom texture map.
Disable texture cache
The plugin builds an optimized cache buffer to increase the render speed. In the most scenes, it works well, but if you get some "blocky" shadows or other visual problems, use this option to disable the cache (you can use it also to compare the render time in both states).
The other parameters works the same as standard shadow maps, and for non Forest objects the shadows obtained are the same.
Enable this checkbox to avoid that a tree cast the shadow over itself.
To get the best results with XShadow, we must understand how shadow maps work:
The "size" parameter in XShadow defines that Max will use a bitmap of that number of pixels to draw the shadows on it. But this map is applied ONLY to the light's hotspot area. So, to get better shadows you must close the hotspot to surround only the objects to shadow. This is a sample of a well adjusted hotspot for XShadow (seen from a light viewport):
Light hotspot adjusted to object
Using a well adjusted hotspot, a shadow map of 4000 pixels should be enough for most scenes. For very large terrains, we suggest you use different cameras and lights, adjusting them individually to shadow only the trees visible in each view or use raytraced shadows.
XShadow needs large buffers of memory to work, and if the scene is complex, Windows might not have enough free memory for it. If this occurs, XShadow stops and displays an error.
And sometimes adding more memory to the system may not solve the problem, especially if you are using a 32 bit version of Windows, because there are other limits due to the 32 bit architecture, for instance memory fragmentation is an issue (when there is free memory that cannot be allocated in a contiguous space).
This is not only an XShadow problem. When Max uses its standard shadow map plugin, and there is not enough memory for the buffers, it doesn't build the shadows but doesn't show any error! This may be annoying for the user, who doesn't know why shadows are not working. In XShadow, we prefer to display a warning message. In order to fix the problem, here are some possible solutions:
- If you have at least 4 GB of memory, always use Windows 64 and 3D Studio 64 bit versions.
- Don't use a higher value than 4000 for the "size" parameter in XShadow. The memory needed grows exponentially with this value. Also, optimize the shadow hotspot of the light (see previous section in this FAQ).
- In XShadow, enable the checkbox "Disable exclusivity buffer" to reduce memory used for XShadow by half. When this option is enabled, the plugin doesn't check to see if each tree shadows itself... but this effect is not noticeable in most of scenes.
- Use raytraced shadows, which are natively supported by Forest.
- XShadow works only with directional lights (targeted or free).
- If you use other lights in scene with shadow enabled (without using XShadow), they cast rectangular shadows for Forest objects... the Forest mesh always exists, of course.
- When using Forest Pro and custom meshes, XShadow builds the standard shadow of an object, except if you enable the checkbox "Cast opacity mask for Custom Object" in Forest's Shadows rollout.