# KTX texture problem

**URL:** <https://forum.babylonjs.com/t/ktx-texture-problem/277>\
**Category:** Bugs\
**Created:** [December 17, 2018, 9:00am UTC](https://forum.babylonjs.com/t/ktx-texture-problem/277 "2018-12-17T09:00:04Z")\
**Posts on this page:** 1\
**Showing post:** 42

<div class="post-metadata">

**Author:** ![johntdaly7](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@johntdaly7](https://forum.babylonjs.com/u/johntdaly7)\
**Post date:** [June 15, 2021, 7:51pm UTC](https://forum.babylonjs.com/t/ktx-texture-problem/277/42 "2021-06-15T19:51:31Z")

</div>

Thanks for checking on that @bghgary. So I can make a cubemap via PVRTexTool for sure. But which function would I then utilize with this cubemap texture?

It seems the CubeTexture() constructor does indeed take in a source url and then automatically appends the px,py,pz,nx,ny,nz extensions to make 6 separate calls to where the textures are. This works fine with jpgs but not ktx files.

Additionally, when I try to use a single cubemap texture -dxt.ktx file and then fall back to the 6 individual jpgs if that does not work, like @Vinc3r did above, that does not work either. I am wondering if they got theirs to work. I have that setup in my current playground here:  
[https://playground.babylonjs.com/#UHQ4FB#5](https://playground.babylonjs.com/#UHQ4FB#5)

and here are my files in S3:

 ![Screen Shot 2021-06-15 at 2.43.39 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/4/e4d9f0c53c1feaaf370a3881ce41b0ec0b1bc581.png)

The CubeTexture.CreateFromImages() function also seems to only take in 6 texture images.

What function would I use for a single cubemap-format -dxt.ktx compressed texture image? Or basis image?

I tried using CubeTexture.CreateFromPrefilteredData(cubeTextureUrl, scene, null, false);

(as seen in this playground):

[https://playground.babylonjs.com/#UHQ4FB#3](https://playground.babylonjs.com/#UHQ4FB#3)

with a cubemap-format (dds) texture. This seems to have the most promise, but the image is decoded/transcoded in a really funky way. I think that might be related to the issues outlined here:  
[Basis support for skyboxes? - #9 by bghgary](https://forum.babylonjs.com/t/basis-support-for-skyboxes/11314/9) even though I am not using Basis.

I’m currently using the cubemap texture from here:

[https://swivel-api-dev.s3.amazonaws.com/skybox\_textures/combined/skyboxConvertedCubeMap.dds](https://swivel-api-dev.s3.amazonaws.com/skybox_textures/combined/skyboxConvertedCubeMap.dds)

Should I not have exported the cubemap into dds format for the CreateFromPrefilteredData function? Which format makes the most sense to maintain as much compression as possible and still work?

I thought only dds/env are compatible to hold a cubemap-format texture.  
Or maybe Basis too, but the issues in the forum post I just posted above in this reply don’t seem to be resolved either.

Thanks!

---

_[View the full topic](https://forum.babylonjs.com/t/ktx-texture-problem/277)._
