Page MenuHome

Collada exporter: Redundancy in UV coordinating
Closed, ArchivedPublic


--- Ubuntu 13.04 x64, Nvidia G105 ---

--- Blender v 2.66 ---

Short description:
I using blender for creating scene for my application, and I'm using Collada format for exporting my scene. when I started importing basic shapes in my 3D engine I encountered some kind of redundancy in UV texture coordinating, I mean <source id="objectMeshName-mesh-map-number"> element in .dae file, It seems the exporter module create UV values for every polygon, while this redundancy is not necessary, redundancy for UV must occur only for vertices that are in unwrap seem edges. I have some algorithm in my mind, but I don't know if it's implemented, can be implemented in blender or even it is a bug or whatever.

2-empty scene
3-create cube
4-triangulate mesh
5-make a proper unwrapping
6-export collada
7-see what redundant collada you have.


To Do

Event Timeline

Gaia, can you please look into this? :)

We could improve the export of UV coordinates by using the same method as we do for exporting of vertex normals:

I think that we only need to store each UV Vertex coordinate (u,v) once in the "mesh-map" array and later adjust the index array of the related <polylist> such that it points to the right uv coordinates in the mesh-map.

As far as i know seams are not exported with Collada (we could eventually add them to the blender collada profile though), so we do not have to take care of them here.

Hi Gaia !
I didn't say to export seam information. I said those vertices that take part in seam edges must be duplicated.
This redundancy is really a big issue, just imagine every object has been exported with collada have a least 7 redundant data per each vertices.
One of the importance of this issue, today every group using other game engines and blender for they modeling, are using collada for exporting method.

hi, Hossein;

Sorry, i just wanted to point out that we do not need to take special care about seem edges when optimizing the UVTexture export. m Imentioned the export of seam information just as a side note.

This isn't a bug, as in - the exporter is working as intended.
Of course the suggested improvement could be made, moving to TODO.

OH! Really! Seven redundant data for vertices which are not participating in seam edges, is not a bug!?
Let me explain more.
When you want to draw a model (I mean mesh or geometry or whatever you say) in OpenGL you must have an unique index for all of the vertices, normals, UVs, etc.
Now look at collada file, expoerter create UVs data for vertices according to each triangle (if your mesh is triangulated), while only those vertices are in "seam edge"s must have multiple UV coordinate. This issue force programmer to copy unnecessary data for each triangle.
For example, assume we have a mesh which has 2000 vertices and only 100 of the vertices participating in "seam edge"s so in theory in worst case you must have (2000 - 100) + (100 * 7) but now exporter easily make 2000 * 7.

Oh sorry for mistake!
Worst case In theory: 2000 + 100 * 7
Current Exporter: 2000 * 8
(for a model which has a well square wired form)