You may leave the ambient light as you wish. It doesn't modify shadows effect itself.
Quote: "Relying on the back face to be in shadow to mask other shadows appearing doesn't seem to be a very usefull device as in most real world situations you wouldn't get this."
I could agree, even with that, the result is not that bad.
If you cannot position the shadow properly, then I suggest using this technique as workaround:
- For each object that should cast shadows, create another -twin- one. Usually with less-poly count, something like this:
dbCloneObject(shadow_object, original_object);
dbSetObject (shadow_object, 1, 1, 0);
dbGhostObjectOff(shadow_object);
dbEnableObjectZWrite(shadow_object);
Then make this twin object to be the one that cast shadows:
dbSetShadowShadingOn(shadow_object);
And hide that twin object using -limb- commands:
dbHideObject(shadow_object);
dbHideLimb(shadow_object,1);
That is, instead of setting shadows on the 'real' object, cast shadows on the hidden twin.
- Now, each loop, position the twin object somewhere along the sun-object vector, until you get the self-shadow applied:
dbSetVector3 ( vector3, original_object_x - sun_X, original_object_y - sun_Y, original_object_z - sun_Z);
dbNormalizeVector3( vector3, vector3);
dbMultiplyVector3 ( vector3, displacement_factor * dbObjectSize(shadow_object) ); //Find the displacement_factor that best fits your media
dbPositionObject( shadow_object, original_object_x-dbXVector3(vector3), original_object_y-dbYVector3(vector3), original_object_z-dbZVector3(vector3));
This tip can also be used to obtain fast shadows and better performance, using a low-poly mesh for the hidden object, and therefore casting low poly shadows.
Quote: "Is this actually done as a post rendering process on the graphics card itself or is it implemented as part of the DB rendering engine "
Both things make sense, don't they? It is a two-pass rendering using stencil buffer, and it is implemented thru the dbSetShadowShadingOn function