# KTX2 As Six Sided Skybox Cubemap Textures

**URL:** <https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971>\
**Category:** Questions\
**Created:** [September 20, 2021, 7:25pm UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971 "2021-09-20T19:25:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [September 20, 2021, 7:25pm UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/1 "2021-09-20T19:25:52Z")

</div>

Yo @bghgary … Did we ever get KTX2 files working with the six sided Cubemap texture?

Do we just specify the faces like:

```auto
_pz.ktx2

```

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [September 27, 2021, 2:48am UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/2 "2021-09-27T02:48:13Z")

</div>

Anybody got any ideas ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 27, 2021, 8:13am UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/3 "2021-09-27T08:13:22Z")

</div>

Yes, I think the cube loader can take any type of files as long as there is a loader for it. As .ktx2 are supported it should work.

Note that per the spec a single .ktx2 file can contain a whole cube texture but it is not supported yet by our .ktx2 loader.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [September 27, 2021, 7:10pm UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/4 "2021-09-27T19:10:21Z")

</div>

Sorry @MackeyK24, I read this before but somehow didn’t reply. What @Evgeni_Popov should be right, but I don’t know that we’ve actually tested it. Let us know if you see any issues.

---

<div class="post-metadata">

**Author:** ![Charge](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Charge](https://forum.babylonjs.com/u/Charge)\
**Post date:** [January 26, 2022, 12:05pm UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/5 "2022-01-26T12:05:47Z")

</div>

Hi @bghgary,  
I’ve tried to use ktx2 images as the 6 sides of a cube texture using the CubeTexture.CreateFromImages method and I cannot get it to work. The cubemap is assigned to a skybox and seems to be transparent/not drawn.  
The exact same process works fine with jpg or png images.  
This is with babylonjs v5Beta4.  
Thanks

_Edit_  
FYI, the ktx2 files I tested were generated using the toktx command line tool with the following params:  
toktx --genmipmap --bcmp --clevel 5

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 26, 2022, 5:12pm UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/6 "2022-01-26T17:12:08Z")

</div>

Can you set up a playground so we can check it? Thanks.

---

<div class="post-metadata">

**Author:** ![Charge](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Charge](https://forum.babylonjs.com/u/Charge)\
**Post date:** [January 27, 2022, 12:18pm UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/7 "2022-01-27T12:18:56Z")

</div>

Hi @bghgary,  
Here is a working playground with jpg files: [https://playground.babylonjs.com/#UU7RQ#2442](https://playground.babylonjs.com/#UU7RQ#2442)

Here is a broken playground with ktx2 files: [https://playground.babylonjs.com/#UU7RQ#2443](https://playground.babylonjs.com/#UU7RQ#2443)

Note that these ktx2 files were generated with the command:  
toktx --bcmp --clevel 5

Thanks.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 28, 2022, 1:14am UTC](https://forum.babylonjs.com/t/ktx2-as-six-sided-skybox-cubemap-textures/23971/8 "2022-01-28T01:14:06Z")

</div>

Thanks. I debugged it a bit. Unfortunately, this isn’t supported yet. Sorry about this. Feel free to file a feature request.
