This was done via the new spherical projection script in Anime Studio, but the same feature exists in most 3D programs. I always wanted to use this for painted backgrounds, but never found some useful grid for it. So I did one myself, here it is for everyone to use:

The image used for the example above:

The bookshelf in the back is something I did quite a while ago and re-used it already in different projects. Import the image into TVPaint and use the warp grid with some good resolution, I used 7 horizontal and 6 vertical points. Select columns of points first (marquee select) to shift horizontally in place. Then place the points so the connecting lines meet or follow the grid lines.

Maybe I'm a bit obsessed with the clear lines, a more painterly approach could be better. Looking forward what others do with this!

You have to learn the grid. Start with a simple subject, like inside a room which is just a box.

You'll notice there's red and green grid lines. A red vanishing point is orientated 90° to a green vanishing point, there are 4 vanishing points in the grid (half a green one left and right). I've named them N E S W (north east south west) here. All verticals are straight, to make things easier, and also because that's what a spherical projection expects.

We look north and want to create our first wall. Start with 2 verticals equally distanced from one vanishing point N. They should be of the same height. Since N is red, you need to use the green lines for the horizontal parts of the wall.

The wall at the east side is 90° to the north wall, so for drawing its horizontals we need to use the red lines now. Of course the grid can't show all possble combinations, so you need to draw between the lines, but you're used to that from inbetweening.

I chose to make the south wall further aways, that means I draw a smaller "rectangle". Again the verticals are equally distanced from the S vanishing point.

Last step is the west wall, just follow the red lines.

Render this and watch in spherical projection: you'll be inside a box, east and west walls equally distanced from you, north wall closer than south wall.