Re: tangent maps

Date : Thu, 25 Jan 2007 10:32:07 -0500 (EST)
To : XSI(at)Softimage.COM
From : "Ben Rogall" <brogall(at)excite.com>
Subject : Re: tangent maps

Andre, very very nice explanation. I've been using XSI tangents recently in experiments with tangent space vector displacement:
http://www.xsibase.com/forum/index.php?board=29;action="" />It took me a little while to realize I had to do the [0,1] to [-1,1] interval correction. I'm also curious to see whether having only 8 bits per channel for the tangent vector is enough to avoid jumping though I haven't seen anything obvious yet.

Another issue with tangent space is difficulty when you try to get different 3D applications to work with eachother. Once you have the normal and tangent vectors, there are still several ways to determine your T,B,N space depending on which of these vectors you decide to orthoganalize to the others. This choice has to match between the applications.

I hadn't even thought about the smoothing issue you mentioned. Is that analogous to the normal automatic discontinuity control?

Also is your tangent display utility publicly available?

Thanks,
Ben


--- On Thu 01/25, =?ISO-8859-1?Q?Andr=E9_Adam?= < a_adam(at)49games.de > wrote:
From: =?ISO-8859-1?Q?Andr=E9_Adam?= [mailto: a_adam(at)49games.de]
To: XSI(at)Softimage.COM
Date: Thu, 25 Jan 2007 11:20:09 +0100
Subject: Re: tangent maps

Hi Bernard,

the tangent property in XSI is the so called tangent map, or tangent
space. Encoded in there you can find a given texture space's u-direction
(the reason why you have to reference a texture projection when creating
a tangent property) in 3d space (you could call this the "texture
mapped" u-direction) on a per sample basis, so we're talking of vectors
here. In absence of a more convenient property Softimage decided to
encode the tangents into vertex colors. That means you have a little bit
of math to do to revert them back to vector data: (VC-0.5)*2. This
formula stretches the RGB vertex color values, which have a 0-1 range,
back to a vector's -1 to +1 range.

The reason you need a tangent space when dealing with normal maps is
that a "normal map in tangent space" (there is also an object space flavour)
stores relative information as to where a given normal should be bent,
which after all is what bump mapping is all about (bump mapping and
normal mappinng are practically the same thing). The lila-blueish color
in a tangent space normal map means that the geometry's input normal
should not be altered, where cyan, magenta, etc colours indicated a
shift in normal orientation.
This shift, which is a relative bit of information as it does not point
to global world coordinates, needs a reference on the object itself from
which the relative shift should be calculated - the tangent space. The
tangent space offers a predefined vector for each sample point and is
directly generated from the texture projection the normal map is mapped
with onto the object.

I've written a small utility that creates little pointers from the
tangent space right on the object's surface to better show the vectors
encoded there. I've attached two screenshots which might clearify that a
bit. The first one shows a straight spherical mapping, the second one is
twisted. As soon as a texture space shows distortions (or even worse:
seams), just like the second one, tangent spaces become tricky; the
samples for a single vertex point in different directions, which finally
would create artifacts during normal mapping. To cope with this issue
the tangent operator in XSI has a smoothing value, which basically
middles the different sample's tangent vectors using an angle-based
approach.

Since the normal map stores its data relative to the tangent space,
generation, as done with the ultimapper for example, therefore always
needs to reference it during generation to provide correct results.
Ultimapper basically marries referenced object curvature from a high
resolution source object with the normals of the low resolution source
object and the tangent space of the low resolution object.

The Photoshop plugins and tools provided by graphics hardware vendors
don't have this kind of 3d information available when generating normal
maps from heightmaps. They assume that the object the generated normal
map might get mapped onto shows an ideal tangent space, which usually is
nonsense. The more distorted the texture space on the mapped object is,
the wronger (is that english?!) the bump mapping results with such a
textures are. I'd stay away from these tools for production work.

Hope that makes some sense, cheers!

-André



Join Excite! - http://www.excite.com
The most personalized portal on the Web!

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.