# \[sandbox\] Render vertex normals renders incorrectly

**URL:** <https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635>\
**Category:** Bugs\
**Tags:** sandbox, inspector, thininstances, bug\
**Created:** [December 30, 2024, 8:41am UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635 "2024-12-30T08:41:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [December 30, 2024, 8:41am UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635/1 "2024-12-30T08:41:46Z")

</div>

Version: 7.42.0  
Engine: webgl2

Steps to reproduce:

1. get a model here:  
[teapots\_galore.zip](https://forum.babylonjs.com/uploads/short-url/tyE9WkDe5xLPIGFO11siXBviFv7.zip) (78.9 KB)
2. Display inspector
3. Find `teapot` mesh  
 ![teapot mesh](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/1/d1272e8972fec976a6c674f163007ed495029f76.png)
4. Check “Render vertex normals”  
 ![Display normals](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/1/b139c316373a44d6a10786f0162c4b252216cb7c.png)

Expected:  
Normals rendered at the position near each instance.

Actual:  
It renders at the center of scene

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/9/196ca9b79e9e872de36e26463203e5651abd20dc.jpeg)

---

<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:** [December 31, 2024, 12:21am UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635/2 "2024-12-31T00:21:10Z")

</div>

This is expected as the normals are only displayed for the root model of the thinInstances.

---

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [December 31, 2024, 12:40am UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635/3 "2024-12-31T00:40:38Z")

</div>

But why is it that big? On non instanced mesh it looks just ok.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/c/6c90357619bba074d2d1acc2653a3dfbe8d3e2c8.jpeg)

---

<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:** [December 31, 2024, 6:24pm UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635/4 "2024-12-31T18:24:29Z")

</div>

This is probably related to the scale of the element

---

<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:** [January 2, 2025, 10:36am UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635/5 "2025-01-02T10:36:09Z")

</div>

The scale depends on the bounding box of the mesh:

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx#L134-L147>

As the bouding box of a mesh with thin instances encompasses all instances, the scale can be quite big. In this case, we should maybe calculate a scale for each instance separately and use the mean of these scales…

---

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [January 3, 2025, 1:49am UTC](https://forum.babylonjs.com/t/sandbox-render-vertex-normals-renders-incorrectly/55635/6 "2025-01-03T01:49:19Z")

</div>

Or just use mesh.rawBoundingInfo/mesh.\_thinInstanceDataStorage.boundingVectors for root model, and render it instanced
