Exporting Blender 2.8 tangent to ogre XML
-
- Gnome
- Posts: 324
- Joined: Sun May 11, 2008 9:27 pm
- x 20
Exporting Blender 2.8 tangent to ogre XML
Doing an experimental blender 2.8 exporter for ogre2.
As far as I understand, a Blender vertex can have multple tangents depending on which face the vertex participates in. In Ogre2's mesh XML, I can only specify one tangent per vertex. Does this mean I cannot map Blender's tangents directly to Ogre?
As far as I understand, a Blender vertex can have multple tangents depending on which face the vertex participates in. In Ogre2's mesh XML, I can only specify one tangent per vertex. Does this mean I cannot map Blender's tangents directly to Ogre?
-
- OGRE Team Member
- Posts: 5502
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1370
Re: Exporting Blender 2.8 tangent to ogre XML
Hi!
When a vertex has more than one normal or tangent, the only solution is to duplicate the vertex. That's how traditional GPUs work.
Cheers
When a vertex has more than one normal or tangent, the only solution is to duplicate the vertex. That's how traditional GPUs work.
Cheers
-
- Gnome
- Posts: 324
- Joined: Sun May 11, 2008 9:27 pm
- x 20
Re: Exporting Blender 2.8 tangent to ogre XML
Thanks for the article. That cleared up things I haven't thought about. Just out of curiosity regarding the optimizations, e.g. a 36 vertices cube with some vertices that share the same normal, and hence one can be eliminated - isn't this type of non-destructive optimization something that should be done in Ogre's XML importer? It would definitely make it easier to make exporters, as you wouldn't have to implement the same advanced optimization algorithm for each exporter. Instead it would be the quick and dirty way without loosing performancedark_sylinc wrote: Fri Apr 17, 2020 7:49 pm Hi!
When a vertex has more than one normal or tangent, the only solution is to duplicate the vertex. That's how traditional GPUs work.
Cheers

-
- OGRE Team Member
- Posts: 5502
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1370
Re: Exporting Blender 2.8 tangent to ogre XML
Importers are usually in a better position since they can detect duplicates as they add new vertices to their sets, and dump only what's necessary (producing smaller outputs and thus improving performance)mrmclovin wrote: Fri Apr 17, 2020 11:26 pm Just out of curiosity regarding the optimizations, e.g. a 36 vertices cube with some vertices that share the same normal, and hence one can be eliminated - isn't this type of non-destructive optimization something that should be done in Ogre's XML importer? It would definitely make it easier to make exporters, as you wouldn't have to implement the same advanced optimization algorithm for each exporter. Instead it would be the quick and dirty way without loosing performance![]()
Blender is an exception though since an exporter written in Python has poor performance.
Exporter performance is also often second class citizen, since it happens offline. Iteration time is still very important though (i.e. modify -> view in-engine -> modify) but you can script two paths: unoptimized (doesn't remove duplicates) and optimized (removes dupes).
- MeshMagick supports removing duplicates. You have to convert it to v1 first though.
- DERGO also has VertexUtils::shrinkVertexBuffer but it's more basic: It removes binary-exact duplicate vertices, and it's just code. It's not an offline tool.