Re-added/fixed optional shadow implementation