Exporters are creating doubles..

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
artich0ke
Gnoblar
Posts: 5
Joined: Sun Jan 08, 2012 2:02 pm

Exporters are creating doubles..

Post by artich0ke » Mon Jan 09, 2012 12:14 am

I made a mesh in blender, exported it as .xml and imported it again, i could remove 600 doubles from the model, so i saved it again and imported it, same issue. I then tried a .mesh file from a game that i'm gonna do some work for. I converted it to .xml and then imported it into Blender, this file also had doubles.

I tried 2 exporters for Blender from this page: http://www.ogre3d.org/tikiwiki/OGRE+Exporters both had this issue.

Does anyone know if the doubling occurs on import or on export, if it occurs only on import it doesnt matter.. maybe the doubling is needed for this format (im new to ogre3D and its format)? if not it's a serious issue.
0 x

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7144
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 14

Re: Exporters are creating doubles..

Post by Kojack » Mon Jan 09, 2012 8:47 am

3d hardware only has 1 normal per vertex. This means that anytime you want a sharp edge in a model (not smoothed) duplicate vertices are needed. They will have the same position and maybe same uv coords, but different normals. For example, a correctly lit cube requires 24 vertices, not 8 like many people assume. Programs like blender can afford to use less efficient internal formats which don't need multiple vertices. Anywhere two adjacent triangles have different uv mappings there will be duplicate vertices too (even if you have a cube with no normals, a minimal of around 12 or so vertices are required for the textures to not be screwed up).
This isn't an ogre issue, it applies to all modern 3d hardware.
0 x

f00bar
Halfling
Posts: 57
Joined: Sun Feb 15, 2009 4:00 am

Re: Exporters are creating doubles..

Post by f00bar » Mon Jan 09, 2012 6:12 pm

To simplify Kojacks answer: You can set the model to smooth shading in blender, then each vertex is exported only once (if material and uv match for faces of vertex). For organic/smooth surfaces that is what you want to use. However, if you have hard edges and depending on material and lighting, this does maybe not look like you want.
0 x

artich0ke
Gnoblar
Posts: 5
Joined: Sun Jan 08, 2012 2:02 pm

Re: Exporters are creating doubles..

Post by artich0ke » Tue Jan 10, 2012 3:36 pm

Thanks for your replies. I never knew smooth shading had an impact on the verticies themselves, thought it was just used as a temporary visual effect.. glad i asked :)
0 x

artich0ke
Gnoblar
Posts: 5
Joined: Sun Jan 08, 2012 2:02 pm

Re: Exporters are creating doubles..

Post by artich0ke » Wed Jan 11, 2012 9:26 pm

hmm i still seem to be able to reduce the file size by first exporting to .xml, load the file again, delete all doubles and export again.. yes i always click "smoothing" first now.

This doesnt always work though, i guess it depends on which format it was before converting it to .xml.. It was successfull with a .obj file where i reduced the file size 25-30% by deleting doubles, compared to not removing the doubles.
0 x

Post Reply