Weird Graphics for Mesh Created By Loading Data

Hi, I am currently attempting to load some data at runtime, and use this data to create a mesh. At the moment, all vertices are placed correctly giving the correct shape. The problem I am having comes down to the normals.


Above are three different scenarios.

When I do not assign any normals to the mesh, I get the result in the top left.

When assigning normals from the data I have loaded, I get the result in the top right. I have also visualised the vertices and normals.

When using RecalculateNormals(), I end up with the result at the bottom.

Firstly, I do not know where the bronze effect is coming from when using my own normals.

Secondly, I do not know why, even after using RecalculateNormals(), the normals are the same, yet produce a different graphical result, with the bronze now covering the entire object.

If anyone has any insight into what may be causing this the help would be appreciated.

As creating meshes from scratch is working fine as far as i experienced… i can only guess:

  • the third image actually looks exactly as it should - recalculate normals did its job fine.
  • where i see the problem is that your normals drawing code may be wrong (the green lines)
  • not only because it looks like a problem with the ray direction, but simply as image 2 and 3 clearly differ, but your green lines stay the same (and i sometimes ran into the same problem of trying to figure out normal problems, while my debug.draw code was to blame for the confusion)

Probably the data isn’t correct, and doesn’t have vertices split on hard edges; shared normals will not work if you want them to look right.

–Eric