# Lightmap uv set not working

**URL:** <https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397>\
**Category:** Content creation (3dsMax, Maya, Blender, glTF)\
**Tags:** lighting\
**Created:** [April 28, 2021, 2:31pm UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397 "2021-04-28T14:31:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/paulr/32/15818_2.png) [@paulr](https://forum.babylonjs.com/u/paulr)\
**Post date:** [April 28, 2021, 2:31pm UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397/1 "2021-04-28T14:31:41Z")

</div>

Hi All,

So i am trying to use a second uv set to bake lightmaps , i have am exporting from maya with two uv`s

Once in the sandbox am loading the lightmap that i`ve generated, but as you can see from the floor material, it doesnt us the uv set 1. Only the first uv0? You can see it has uv0 and uv1 in the object.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/e/efa97632be3a2aa5cbf6f24ce95f744503a5914e.jpeg)

Any ideas? Thanks

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 28, 2021, 2:52pm UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397/2 "2021-04-28T14:52:28Z")

</div>

Not on the top of my head ☹ would you be able to provide a repro in the playground ???

---

<div class="post-metadata">

**Author:** ![Raggar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raggar/32/20672_2.png) [@Raggar](https://forum.babylonjs.com/u/Raggar)\
**Post date:** [April 28, 2021, 3:01pm UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397/3 "2021-04-28T15:01:55Z")

</div>

Not sure about the sandbox, but when you load a texture, you can specify another coordinatesIndex to use another UV. [Texture | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.texture#coordinatesindex)  
Setting it to 1 uses UV2 instead of UV1 - or 0 depending on how you want to index it.

---

<div class="post-metadata">

**Author:** ![paulr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/paulr/32/15818_2.png) [@paulr](https://forum.babylonjs.com/u/paulr)\
**Post date:** [April 28, 2021, 3:18pm UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397/4 "2021-04-28T15:18:37Z")

</div>

Hi  
Cant upload here as i`m a new user, i`ve added it to a onedrive. just the carpet model and the lightmap if you are able to test that would be great. thanks  
[https://1drv.ms/u/s!AseZdNEMLghX\_RE06Pmy43TcpMPH?e=qU9iD3](https://1drv.ms/u/s!AseZdNEMLghX_RE06Pmy43TcpMPH?e=qU9iD3)

---

<div class="post-metadata">

**Author:** ![3dprof.com](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/3dprof.com/32/1408_2.png) [@3dprof.com](https://forum.babylonjs.com/u/3dprof.com)\
**Post date:** [April 29, 2021, 8:17pm UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397/5 "2021-04-29T20:17:25Z")

</div>

Hi @paulr

After add lightmap file ;

UV set ===\> 1 ,

Then update lightmap U scale , V scale to zero and 1 again

!!! You must make this in your own code

( I thought its a exporter problem )

hv nice works.

Here is the video

[https://1drv.ms/v/s!At8Mj\_69ieo1ihYBlitytx1NmxKj?e=JRGX5V](https://1drv.ms/v/s!At8Mj_69ieo1ihYBlitytx1NmxKj?e=JRGX5V)

---

<div class="post-metadata">

**Author:** ![paulr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/paulr/32/15818_2.png) [@paulr](https://forum.babylonjs.com/u/paulr)\
**Post date:** [April 30, 2021, 10:28am UTC](https://forum.babylonjs.com/t/lightmap-uv-set-not-working/20397/6 "2021-04-30T10:28:58Z")

</div>

Thanks very much for taking the time to check that @3dprof.com , that works great.
