How to create a skybox with a single HDR file

Hey there

I spent a while figuring out how to set up a HDR environment from polyhaven. I created a sphere for the sky using a HDRCubeTexture, but found there were issues with rotations (notice how the clouds are flipped upside down!), and ended up spending a couple hours trying to figure out how to fix it
image

I found this site → HDRI to CubeMap which is really useful for converting a single HDR file into 6 seperate images for an ordinary CubeTexture skybox.


If you select the third option it will download a zip file with each of the 6 images following the same naming system as Babylon, just rename them from “nz” to “skybox_nz” for example, and change them from pngs to jpegs.

Just putting this here in case someone has the same issue in the future :slightly_smiling_face:

5 Likes

This sounds interesting. Looks a bit like the PSD template I am building. Is it masks I see in there? How good is the result? It would be great if you could add a couple of examples to see the result.
Else, I might just give it a try and then, thanks for sharing.

1 Like

The result seems pretty normal, albeit somewhat blurry. I’m not sure whether that’s because I used a 2k HDR though :thinking:


1 Like

Thanks for the examples. Simple and convincing enough to have me give it a try for my outer space skybox. I will share the result here. Meanwhile, have a great day :sunglasses:

1 Like

Thank you, you too :slight_smile:

Ooh, I think I know why the skybox is blurry. The HDR is 5.5Mb, but the 6 images combined are only 483Kb. I must have selected a 256p resolution on the website
image


I’m not sure whether the screnshot shows it well, but exporting at 2048p looks fantastic :smiley: (even if it takes ages to load, it’s 10mb :rofl:)
Cheers

Thanks for the update. I will likely give it a try later today or tomorrow and will let you know.

2 Likes

OK, so this small tool is sure nice to convert an equirectangular 360° already finalized texture to a simple cube map. Nice, but not what I had hoped it would be. The gradients I see on the thumbnails are no masks. It doesn’t do anything towards the integration of sides. It cannot be used from a single 2D image.
So, back to my photoshop making for me. I will continue my work and try finalize my template and script to convert a single 2D image into a seamless skybox cube. The good thing is I need it only for a space scene for now, so I don’t really have to bother about the skyline. I thought this tool would eventually relieve me from some editing work :grin: Silly me, back to work now :sweat_smile:

1 Like

The Photoshop plugin you are making sounds really useful, really looking forward to seeing it! :smile:
Just wondering, what are masks?

Masks will make the integration between sides. The image is duplicated or mirrored and a mask is applied to it to help make a seamless integration between sides (that originally do not connect).

1 Like

Ooh, that’s really cool! Can it be used for complex skyboxes?

We’ll see about that. I’ll post something here when it’s done. Meanwhile, have a great day :sunglasses:

Awesome, can’t wait to see :))
Have a great day too

Hi,
Hope you’re well.
My progress can be seen here:

Meanwhile, have a great day :sunglasses:

2 Likes