Skip to content

Skybox generation

HugoFara edited this page Oct 5, 2024 · 3 revisions

Skybox generation

This tasks uses a simple combination of models: image generation and inpainting. The idea is to use inpainting for image-to-panorama generation by rewriting the image borders. Then, using two projections, a panorama-to-skybox is acheived.

Text-to-image

The next image is an AI-generated landscape of a sunny mountain, using StableDiffusion XL 1.0 (base only).

AI-generated landscape with a mountain.

Image-to-panorama

We want to create an horizontal panorama from the image, so that no seam line appears at the image borders. This is relatively easy when we formulate the issue as the creation of an asymetric tiling tile. The idea is to simply inpaint the borders of the image to make them match.

Image with flipped sides A central vertical white band

With the image and the mask, the inpainted result is:

Inpainted landscape without seam line

Projected in the initial view: The original landscape with corrected borders

Panorama-to-skybox

For this step, we use polar projections first, but the idea is the same.

For the ground, we extend the lower part of the image as a base for the inpainting.

Polar projection of the lower half of the image A white disk on a black background

We apply a classical inpainting.

The resulting inpainted ground

Now we apply a reverse polar projection.

The new ground matching the image

The same procedure is applied for the sky. The main difference is that we select pixels from the sky before the inpainting, other tall elements would be dupplicated.

Clone this wiki locally