Exporting from blend to ogre xml creates duplicate vetices?

Hello,

this is not exactly a JME issue (maybe it’s not issue, but feature :] ), but I’d like to ask others about their opinion on this.

Problem is: whenever I export a mesh from blender to xml the number of vertices rises a lot. For example my little character went from 158 blender vertices to 727 ogre vertices, nice! I thought “well i’m pretty new to blender, so there may be something wrong with my model”, so i just let blender generate an icosphere: 42 vertices in blender, 240 in ogre xml. Here it’s even funnier, because it is constructed from 80 triangles… So yea, 240 vertices, but each vertice is part of 6 different triangles! To be fair I have found one model, which exports from 350 to 482 vertices (360 to 696 faces)

Is it some bug in the exporter? Or is it the way Ogre works and theres nothing to do with it? Am I doing something wrong in Blender? (tested with Blender 2.61, 2.63 and exporters 0.5.5-0.5.9)

Are you using smooth or flat shading? Do you have lots of different materials?

1 Like

Flat shading. Switching to smooth - works better, only 505 (from 158) vertices. And theres no material yet.

EDIT:

Wow, thanks… Removing UV map (How the hell did it get there, I don’t remember creating one) and switching to smooth shading works… Do you know why smooth shading works better? For example that icosphere – flat shading = 240 verts, smooth shading = 42 verts…

Ummm, can I delete this double post?

This is normal because I think the Ogre XML format maintains a separate normal vector for each vertex. In flat shading, each face has a different normal. Thus, a single vertex is separated in several, each one having a different normal vector.

1 Like

In order to do flat shading you need multiple vertices at each “corner” of the shape since each needs to have a different normal direction. The single blender vertex gets split into one for each face with identical position but different normals…

The same potentially applies with UV mapping as well, if the texture co-ordinates are different even if the normals are the same you need a new vertex.

1 Like