Attention Exporter Developers: New Tangent Flags in Shoggoth

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Attention Exporter Developers: New Tangent Flags in Shoggoth

Post by sinbad » Tue Jan 08, 2008 12:15 pm

If you develop exporters or tools for Ogre, you will want to read this!

In CVS HEAD (Shoggoth), enhancements have been made to the tangents generation process - this means that tangents are better quality than before, and deal much better with discontinuities in the UV space and UV mirroring.

Things that are automatic:

:!: Weighting of tangent space contribution by triangle area and 'angle' at a given vertex
This means that variations in tesselation level are handled better and small triangles cannot bias / 'bend' the tangent space.

:!: Multiple submeshes referencing the same shared geometry will now calculate shared tangents properly at boundaries between submeshes

Things that require changes by you:

:!: You can now generate 4-component tangents, where the 'w' component contains the 'parity' of the tangent space; 1 if it's right-handed, -1 if it's left-handed (mirrored). Shaders can use this to deal with UV mirroring in tangent space cleanly. It's exposed as the option '-ts 4' ('-ts 3' is the default) in command-line tools, and is added to the Mesh::buildTangentVectors parameter list. Note that you will probably also need the 'Split Mirrored' option below too.

:!: Split Mirrored You can now tell the generation process to split vertices when the tangent space is mirrored at a vertex, ie there's a single vertex where the tangent space goes in 2 different directions. Splitting the vertex allows each side's tangent space to be accurately stored instead of the mirrored versions being averaged out incorrectly. You will probably want to use this in combination with the 4-component tangents option. It's '-tm' in command-line tools, and is available in Mesh::buildTangentVectors

:!: Split Rotated You can now tell the generation process to split vertices when the tangent space is excessively rotated at a vertex, ie there's a single vertex where the tangent space changes sharply (but is not mirrored). Splitting the vertex here can lead to better results because tangents are not averaged over wildly different bases. It's the '-tr' option in command line tools, and is available in Mesh::buildTangentVectors

Hope that helps. I'll be modifying the XSI, Milkshape and Maya exporters, I would appreciate it if other tool developers would review their tools in the light of these enhancements. Obviously the facilities are only available in tools built against the Shoggoth codebase, but the .mesh files produced can actually be used in Eihort runtime applications, including 4-component tangents, so long as the tangents aren't regenerated or converted to/from XML with Eihort code.
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Tue Jan 08, 2008 8:50 pm

This would not apply to exporters such as ColladaMaya/ColladaMax and the OgreCollada pipeline, correct? This is strictly changes in the way the Mesh class generates tangents?
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Tue Jan 08, 2008 10:18 pm

It only affects tools that want to generate tangents using the Mesh::buildTangentVectors method, or which launch the XML converter to do it.

[edit]Also, anything that wants to generate tangents now can do it outside of Mesh now. Calculation of tangent space can be done using the TangentSpaceCalc class (which Mesh uses to do its calculations), which you can use to calculate tangents for any geometry.
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Re: Attention Exporter Developers: New Tangent Flags in Shog

Post by haffax » Tue Jan 08, 2008 11:25 pm

sinbad wrote:I would appreciate it if other tool developers would review their tools in the light of these enhancements.
MeshMagick will incorporate this change, when Shoggoth enters prerelease stage. It is only minor in this case anyway. Which suits me just fine, as I absolutely don't have time for hobby projects right now. :(
There will be other times again, but not before middle next month, I fear.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme » Thu Nov 20, 2008 12:06 am

I noticed that the latest installer for command line tools does not include the fancy new tangent generation options. Will there be an updated version or do I have to get it from SVN?
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Thu Nov 20, 2008 12:24 pm

Oops, I forgot. Will resolve.
0 x

Post Reply