Godot version:
3.2 dev
OS/device including version:
Windows 10 x64 / NVIDIA GeForce GTX 1060 6GB / Intel Core i7 4790K
Issue description:
When Viewport is used, shadows don't work:

Also as you can see, the first time I drag the ViewportContainer and click on stretch, it's with a black background and after if I move it a little, the black background disappears and the cube image appear, but with no shadows...
Steps to reproduce:
1) Open and run the project. No shadows.
2) move the camera out of viewport container and delete it. Shadows are ok.
Minimal reproduction project:
surface1.zip
You need to increase the Viewport's shadow atlas size to at least 1 (it's in pixels), even though it's not used for directional shadows.
We should document this. At the very least, mention in the class reference that shadow_atlas_size defaults to 0 so shadows won't be drawn unless it is increased. But I think we should also reference it in the viewports tutorial. http://docs.godotengine.org/en/latest/tutorials/viewports/viewports.html
This seems to be fixed by https://github.com/godotengine/godot/pull/31976 and https://github.com/godotengine/godot-docs/pull/2743.
Thanks, closing.
Most helpful comment
We should document this. At the very least, mention in the class reference that
shadow_atlas_sizedefaults to 0 so shadows won't be drawn unless it is increased. But I think we should also reference it in the viewports tutorial. http://docs.godotengine.org/en/latest/tutorials/viewports/viewports.html