vtlib Structure Shadowtextures
What's implemented in the VTP currently is a 'shadow texture' which is
generated from the loaded structures (e.g. buildings) and cast onto the
terrain. It can be enabled from the Enviro terrain parameters dialog.
Shadows are automatically re-calculated whenever the time of day changes by
an hour, so the Time dialog is useful to trigger the recalculation.
- Since the underground parts of the buildings are also used to form the
mask, there are small shadows "in front" of buildings embedded on slopes.
This is possibly avoidable by rejecting the front-faces during the shadow
rendering, so that only backfaces (normally not rendered) cast a shadow.
- Curious wide areas of transparency (!) may appear in the terrain, on the
sides of the projected area. They move with the light direction. Actually,
this only happens when the resolution of the mask texture is larger than
256. I've stared at the code to see if there are uncalculated dependencies
on this resolution, but i don't see any.
- It appears that some code is using the camera position from the last
frame, resulting in a 1-frame lag. This is surely a result of "ordering",
the order in which things happen each frame. To fix, we must ensure that the
camera position is updated _before_ it is used to set up the shadow stuff.
- Yellow structure highlight also casts a shadow... a yellow shadow.