Does vitamin D synthesis require direct sunlight, or does it work with scattered light as well?

Not really, it requires direct sunlight above 45 degree, so northern sweden for example gets plenty of sun in summer, but only for a very short time intense enough sun.