# MeshDebugPluginMaterial Bug: vMainUV1 undeclared identifier

**URL:** <https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945>\
**Category:** Bugs\
**Created:** [April 23, 2024, 2:08pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945 "2024-04-23T14:08:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [April 23, 2024, 2:08pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/1 "2024-04-23T14:08:59Z")

</div>

Hi~  
When I display some model, UV0 mode throw “vMainUV1 undeclared identifier”. It is sure that mesh contains uv0.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/7/c76c5801ebdf7b24c22b794a4cc3c687e5cb2741.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/3/7398feaf67ae04f19c3bddcda055d609a4ec875e.png)

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [April 23, 2024, 2:24pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/2 "2024-04-23T14:24:21Z")

</div>

It looks like that there is no error with pbrMaterial

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/9/09d35ef450bf7138194c981c18285f2ce77cf241.jpeg)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 23, 2024, 3:30pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/3 "2024-04-23T15:30:09Z")

</div>

cc @Evgeni_Popov

---

<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:** [April 24, 2024, 3:56pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/4 "2024-04-24T15:56:49Z")

</div>

Would you be able to share the model that generates the error?

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [April 25, 2024, 2:33am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/5 "2024-04-25T02:33:07Z")

</div>

Sorry, it is a fbx file, I think it is hard to regenerate in pg. I have a try to export model with .babylon

> **[Babylon.js Playground](https://playground.babylonjs.com/#9IFL43)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [April 25, 2024, 2:49am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/6 "2024-04-25T02:49:56Z")

</div>

The textures of model are .dds, does it matter?  
Model with other format Textures work well. Only .dds throw error.  
Model with other format

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/2/02358993f6f5055f55b90e53cdc47b098ef49bb1.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/1/2157e1bc332c2222c644bc7993e5029e00e56983.jpeg)  
Model with .dds  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/d/bddd32e7be5abb6437a59747ff35adfc504e466a.jpeg)

---

<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:** [April 25, 2024, 5:15am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/7 "2024-04-25T05:15:19Z")

</div>

Your PG does not generate an error: we would need a PG with the error to be able to understand what’s going on.

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [April 25, 2024, 6:19am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/8 "2024-04-25T06:19:24Z")

</div>

Here I generate the error : [https://playground.babylonjs.com/#PSP5JI#7](https://playground.babylonjs.com/#PSP5JI#7)  
I find vScale cause the error.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/0/20a362d4430144ef6f1795e1e8836f31b1325009.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:** [April 25, 2024, 2:46pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/9 "2024-04-25T14:46:24Z")

</div>

Assigned @Evgeni\_Popov on April 25, 2024, 2:46pm UTC



---

<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:** [April 25, 2024, 4:46pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/10 "2024-04-25T16:46:09Z")

</div>

The problem will be fixed by [Mesh debug material plugin: Fix crash when showing uvs by Popov72 · Pull Request #15034 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/15034).

However, the “uv” debug mode won’t work in your case, because when you don’t use an identity transformation matrix for at least one texture, we don’t directly use the uv vertex buffer but we recompute specific uv values by factoring the transformation matrix.

---

<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:** [April 25, 2024, 4:46pm UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-bug-vmainuv1-undeclared-identifier/49945/11 "2024-04-25T16:46:14Z")

</div>

Unassigned @Evgeni\_Popov on April 25, 2024, 4:46pm UTC


