Ok, this is what I did:
- Comment large blocks of code, until the solid shadows disappeared
- Shorten the commented blocks of code until the problematic code was isolated
- I finally found the single line that was causing the problem, and believe it or not it was:
dbHideObject(ObjNum);
So I changed it for :
dbPositionObject(ObjNum, 100000, 100000, 100000);
And the shadows work fine!
Now this has been totally empirical, I cannot imagine any relationship between dbSetShadowShadingOn and dbHideObject. This reveals some weakness of the shadow system, which, in fact, is no new at all.
Besides, this cannot be reproduced alone in a example code, or at least I haven't been able.
Uh, I lost more than two weeks hunting down this issue. A total undesirable luxury.
[EDIT] One additional comment: I've tested this with an ATI Radeon 9700pro, and with a NVIDIA Geforce 8800gts, and the behaviour was the same, so this is not a hardware/drivers issue.