# Lightmaps as KTX2 UASTC encoding

**URL:** <https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944>\
**Category:** Questions\
**Created:** [September 18, 2021, 9:59pm UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944 "2021-09-18T21:59:03Z")\
**Posts on this page:** 7\
**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 18, 2021, 9:59pm UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/1 "2021-09-18T21:59:03Z")

</div>

Yo @Evgeni_Popov … I got a question about lightmaps…

Right now, i currently PACK my lightmaps into a RGBD/PNG image.

Is there ANY advantage to further encoding those lightmaps as KTX2.

Without using lossy compression that ktx2 image file can be quite large… i am assuming because of the full mipmap chain.

Should i keep lightmaps as RGBD packed PNG files or should i go ahead and convert those lightmaps to KTX2 with toktx.exe ???

---

<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 19, 2021, 12:07am UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/2 "2021-09-19T00:07:06Z")

</div>

I don’t really know…

I think the best way is to test. You should try to use etc1s which compresses better than uastc. I think it should work ok for a lightmap.

Or maybe the easiest: just give the choice to the user to use rgbd/png or ktx2 for lightmaps, that way it’s up to the user to decide what they want to use.

---

<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 19, 2021, 5:09am UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/3 "2021-09-19T05:09:24Z")

</div>

hmmm…  
@Evgeni_Popov

If i just use **–uastc 2** as the args… the light maps look crappy, not anywhere as clean as RGBD packed png.

What would be the toktx to create a mipmap ktx2 with LOSSLESS compression so that lightmaps dont look like crap… Or i guess i could always keep lightmaps as PNG.

---

<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 19, 2021, 10:38am UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/4 "2021-09-19T10:38:11Z")

</div>

There’s no lossless compression with uastc/etc1s I think, that’s the point of the format, to have lower texture sizes. You can try to use other levels for uastc and see if that helps (the 2 in `--uastc 2`).

It seems ktx2 lightmaps are working ok for him: [GitHub - 0beqz/lightmap\_interior\_test: three.js lightmap interior test](https://github.com/0beqz/lightmap_interior_test)

---

<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 19, 2021, 5:14pm UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/5 "2021-09-19T17:14:22Z")

</div>

I will try without RGBD packing the png before converting to ktx2

Also , I thought the point of ktx was preparing the texture for GPU… like pre mipmapoing… and the compression was another feature

But I understand if everything has some compression on

---

<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 19, 2021, 10:03pm UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/6 "2021-09-19T22:03:33Z")

</div>

Maybe this doc will help shed some light:

> **[KTX2 Compressed Textures | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/materials/using/ktx2Compression)**
>
> Learn advanced texture compression with KTX2 support in Babylon.js.

---

<div class="post-metadata">

**Author:** ![evidanary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evidanary/32/26170_2.png) [@evidanary](https://forum.babylonjs.com/u/evidanary)\
**Post date:** [December 17, 2023, 6:04am UTC](https://forum.babylonjs.com/t/lightmaps-as-ktx2-uastc-encoding/23944/7 "2023-12-17T06:04:48Z")

</div>

@MackeyK24 not sure if this was the case for you but the texture doesn’t need a vscale of -1 when converting to ktx2 from tools like toktx. That solved it for me.
