# MeshDebugPluginMaterial Vertex information error

**URL:** <https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494>\
**Category:** Bugs\
**Tags:** meshdebugpluginmater\
**Created:** [May 13, 2024, 7:41am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494 "2024-05-13T07:41:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [May 13, 2024, 7:41am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494/1 "2024-05-13T07:41:53Z")

</div>

I found that after using PrepareMeshForTrianglesAndVerticesMode, the number of vertex information is not three times that of the original model, but the number of triangles is three times that of the original model.

Documentation:  
_`PrepareMeshForTrianglesAndVerticesMode` is tripling the number of triangles and vertices in the mesh’s vertex buffers_

[https://doc.babylonjs.com/features/featuresDeepDive/mesh/visualizeMeshData#triangles-mode](https://doc.babylonjs.com/features/featuresDeepDive/mesh/visualizeMeshData#triangles-mode)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/a/fae42b79f0fafb0449033288d063789ea834b405.jpeg)

example:

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

```auto
faces:: 6036
vertices:: 12072

```

---

<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:** [May 13, 2024, 9:50am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494/2 "2024-05-13T09:50:53Z")

</div>

You’re right, this PR will fix the note:

> <https://github.com/BabylonJS/Documentation/pull/1132>

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [May 13, 2024, 10:12am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494/3 "2024-05-13T10:12:33Z")

</div>

@Evgeni_Popov How to calculate the original number of vertices based on the number of vertices after using MeshDebugPluginMaterial?

---

<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:** [May 13, 2024, 11:31am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494/4 "2024-05-13T11:31:25Z")

</div>

You can’t, because some vertices could have been reused multiple times in the original index buffer. The easiest way to know is to simply do `mesh.getTotalVertices()` before calling `PrepareMeshForTrianglesAndVerticesMode`.

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [May 13, 2024, 11:43am UTC](https://forum.babylonjs.com/t/meshdebugpluginmaterial-vertex-information-error/50494/5 "2024-05-13T11:43:49Z")

</div>

Okay, I understand
