Load cubemap as a single file

Hello,

I want to load a cubemap as a single file, not split into 6 parts. Is this possible? I would like to load eg Skybox Texture free download - 512*384, 157.93 KB into my scene. However I don’t want to split it manually like in Skyboxes | Babylon.js Documentation

best regards

Well, a cube map is (sry) a ‘cube’ + ‘map’. Each side of a texture is assigned to a side of the cube. Now, you sure can load the entire image, but then next, what would you do with it?

With the single image loaded I want to apply it to the cube. Babylon should wrap it around the cube on its own. If this is possible

It is. But (usually) not just exactly like this. You can wrap a texture around a cube (or asign sides) but usually this texture will be divided in 6 faces (generally all horizontally or with a sheet). It would of course still be possible to straight use your download skybox image (ignoring some of the faces). But it would certainly be cleaner to create a new texture (with 1 line of 6 sides or 2 lines of 3)

May be simply check out this link. I’m sure you’ll find your answer in there:

1 Like

Yes, with HDRCubeTexture (only works with HDR Files). Here is example code:
See example PG of Skybox with a single HDR texture.

The HDR file must be in equirectangular panoramic mode.

2 Likes

I believe the link for this free skybox is not hdr and he might not have the tools or will to edit it (or else, he would have easily cropped it to turn it into a regular skybox tex)? However @Myrmod, you might know (or not) that there are online free tools to convert your textures to hdr and even to equirectangular. You can just make a search in google (i cannot really list’em here since this is no place for advertising side apps;) Let us know if you still need more help…

this seems like the way to go for me. I learned some new words thanks to you and @ecoin. Thanks a lot you two.

Took me a while to understand, but I got it working: https://playground.babylonjs.com/#ICLXQ8#355

3 Likes

This is indeed working. GJ :smiley: