[sandbox] Render vertex normals renders incorrectly

Version: 7.42.0
Engine: webgl2

Steps to reproduce:

  1. get a model here:
    teapots_galore.zip (78.9 KB)
  2. Display inspector
  3. Find teapot mesh
  4. Check “Render vertex normals”

Expected:
Normals rendered at the position near each instance.

Actual:
It renders at the center of scene

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

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

This is probably related to the scale of the element

The scale depends on the bounding box of the mesh:

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…

2 Likes

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