> How about parallax mapping, can you shed some
> light on that technique?
Andr=E9 already explained it nicely.
I wanted to see if I could quickly mop up a rendertree that does =
parallax mapping, and it worked :) Looks quite nice, even.
Here's a quick render:
http://animus.brinkster.net/temp/Parallax.mov
I also put the scene up:
http://animus.brinkster.net/temp/Parallax.zip
You can play with the PARALLAX_SCALE and PARALLAX_OFFSET nodes to =
influence the strength of the effect.
Ciao, Daniel!
PS: Looking at the render tree can also cause nausea, headaches and/or =
breathing difficulties :P
----- Original Message -----=20
From: Tim Leydecker=20
To: XSI(at)Softimage.COM=20
Sent: Friday, January 26, 2007 10:44 AM
Subject: Re: tangent maps
It seems there=B4s all sorts of workflows superior to the
more traditional bumpmap implementation, starting with
Ben=B4s ZBump, various ways of Normalmapping and last
but not least just tesseleating the mesh to infinity and using
a displacement instead - or even a vector displacement.
Problem is, as allways, the limited information available
like, "now is that stored in float or clamped8bit..."
Pretty hard to get to a point of confidential usage then,
or as you=B4ve put it - use it in production asap.
Cheers
tim
----- Original Message -----=20
From: "Andr=E9 Adam" <a_adam(at)49games.de>
To: <XSI(at)Softimage.COM>
Sent: Friday, January 26, 2007 9:58 AM
Subject: Re: tangent maps
> I've a whole bunch of programmers around here that got headaches =
because of those=20
> alpha values; actually we did not find out up to now and my personal =
opinion still=20
> is it simply is trash (though I'm the only one over here with that =
opinion...).=20
> Anyone from Soft like to give us a hint?
>
>
> Ben Rogall wrote:
>>
>>
>> Thanks for forwarding that Andre. The hardest part about the vector =
displacement=20
>> was setting up the tangent space conversion. Well, that and trying =
different ways=20
>> of exporting objects and mapping the position data. Mental Ray =
already knows how=20
>> to do multi-directional displacement.
>> Regarding the bit-depth of the tangent property, if I read out any =
of the values,=20
>> say by checking the SDK explorer and multiply by 255, I get a whole =
number. Btw, I=20
>> have no idea what is being stored in the alpha channel.
>>
>>
>>
>> --- On Thu 01/25, =3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D < =
a_adam(at)49games.de > wrote:
>>
>> *From: *=3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D [mailto: =
a_adam(at)49games.de]
>> *To: *XSI(at)Softimage.COM
>> *Date: *Thu, 25 Jan 2007 17:32:02 +0100
>> *Subject: *Re: tangent maps
>>
>> Hi Ben,
>>
>> thanks for the kind words! Very nice work on the displacement =
mapping!
>> A vertex colour property stores float values, not 8bit data, so
>> you're
>> practically lossless when converting back to vectors. The =
smoothing
>> works similar, since it is angle based, but is not connected in
>> any way
>> to the geo approximation or the normals. In theory, the normal =
map
>> should be able to compensate cracks in the tangent space, but
>> practically the normal map's texels would have to line up
>> perfectly with
>> the polygon edges which is a very unlikely occasion. So, as =
soon
>> as you
>> try to fit a normal map texture with its pixel raster onto =
uneven 3d
>> geometry, the tangent space needs to be smoothed to avoid =
cracks
>> and seams.
>>
>> I've attached the script to this mails, but really, this is =
nothing
>> fancy, just a one-time creation of null objects pointing in the
>> vector's
>> direction. A compiled operator with live-input certainly would =
be way
>> nicer. Oh, and it is slow, be careful with meshes heavier than =
-
>> say - a
>> thousand polygons, trying it out on small objects will be more
>> fun... :)
>>
>> Cheers!
>>
>> -Andr=E9
>>
>>
>> Ben Rogall wrote:
>> >
>> > Andre, very very nice explanation. I've been using XSI =
tangents
>> > recently in experiments with tangent space vector =
displacement:
>> >
>>=20
>> =
http://www.xsibase.com/forum/index.php?board=3D29;action=3Ddisplay;thread=
id=3D28834;start=3D0
>> > 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, =3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D <
>> a_adam(at)49games.de >
>> > wrote:
>> >
>> > *From: **=3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D [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=E9
>> >
>> =
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>> "Show Tangents" / Andr=E9 Adam
>> Tool to create null object pointers on an polymesh object's =
surface
>> to visualise direction in a tangent space.
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D*/
>>
>>
>> function fGetPointer(oObj, oSize){
>> var oNull, oDisplay
>> oNull =3D oObj.AddNull();
>> oNull.Parameters("Primary_Icon").Value =3D 9;
>> oNull.Parameters("Size").Value =3D oSize;
>> oDisplay =3D oNull.AddProperty("Display Property");
>> oDisplay.Parameters("wirecol").Value =3D =
Math.round(Math.random()*1023);
>> return oNull;
>> }
>>
>> function fGetTangents(oPolyMsh){
>> var eVCs =3D new Enumerator(oPolyMsh.VertexColors);
>> while(!eVCs.atEnd()){
>> if(eVCs.item().Name =3D=3D "Tangents"){
>> return new VBArray(eVCs.item().Elements.Array).toArray();;
>> }
>> eVCs.moveNext();
>> }
>> return false;
>> }
>>
>> function fGetSamplePositions(oPolyMsh){
>> var aSamplePositions =3D new Array();
>> var ePoints =3D new Enumerator(oPolyMsh.Vertices);
>> for(var i=3D0; i
>> ePoints.moveFirst();
>> while(!ePoints.atEnd()){
>> var eSamples =3D new Enumerator(ePoints.item().Samples);
>> while(!eSamples.atEnd()){
>> if(eSamples.item().Index =3D=3D i){
>> aSamplePositions.push(ePoints.item().Position);
>> }
>> eSamples.moveNext();
>> }
>> ePoints.moveNext();
>> }
>> }
>> return aSamplePositions;
>> }
>>
>> function fShowTangents(oObj, oSize){
>> var oPolyMsh =3D oObj.ActivePrimitive.Geometry;
>> var aTangents =3D fGetTangents(oPolyMsh);
>> if(aTangents){
>> var aSamplePositions =3D fGetSamplePositions(oPolyMsh);
>> for(var i=3D0; i var vY =3D
>> XSIMath.CreateVector3((aTangents[i]-0.5)*2,
>> (aTangents[i+1]-0.5)*2, (aTangents[i+2]-0.5)*2);
>> var vX =3D XSIMath.CreateVector3(0, 1, 0);
>> var vZ =3D XSIMath.CreateVector3();
>> vZ.Cross(vY, vX);
>> vX.Cross(vY, vZ);
>> vX.Normalize(vX);
>> vY.Normalize(vY);
>> vZ.Normalize(vZ);
>> var oM3 =3D XSIMath.CreateMatrix3(vX.X, vX.Y, vX.Z, vY.X, vY.Y,
>> vY.Z, vZ.X, vZ.Y, vZ.Z);
>> var oTrans =3D XSIMath.CreateTransform();
>> oTrans.SetRotationFromMatrix3(oM3);
>> oTrans.SetTranslation(aSamplePositions[i/4]);
>> oTrans.SetScalingFromValues(0.25, 1, 0.25);
>> var oPointer =3D fGetPointer(oObj, oSize);
>> oPointer.Kinematics.Local.Transform =3D oTrans;
>> }
>> }
>> else{
>> LogMessage("aa_ShowTangents: No tangents found on object!", =
siError);
>> }
>> }
>>
>> =
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>> MAIN
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D*/
>>
>> if((Selection.Filter.Name =3D=3D "object") && (Selection.Count =
=3D=3D 1)
>> && (Selection(0).Type =3D=3D "polymsh")){
>> fShowTangents(Selection(0), 1);
>> }
>> else{
>> LogMessage("aa_ShowTangents: Not a single polymesh object
>> selection!", siError);
>> }
>>
>> =
------------------------------------------------------------------------
>> *Join Excite! - http://www.excite.com*
>> The most personalized portal on the Web!
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in =
body:
> unsubscribe xsi=20
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in =
body:
unsubscribe xsi
------=_NextPart_000_009C_01C7415E.D8F16B20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>> That only 8bit data thing for the tangents =
is odd,=20
since they use float arrays... <BR>> on the other hand, that whole =
normal=20
mapping technique is unprecise as hell <BR>> anyways, so I guess =
nobody will=20
ever notice... ;)
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>From taking a look at the SDK docu, it =
seems that=20
Vertex Color properties (like the tangent op generates) are stored as =
short int=20
internally. Still, that should give 65k colors per channel, not=20
256...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>> How about parallax mapping, can you shed some<BR>> light on =
that=20
technique?</DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Andr=E9 already explained it =
nicely.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I wanted to see if I could quickly mop =
up a=20
rendertree that does parallax mapping, and it worked :) Looks quite =
nice,=20
even.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Here's a quick render:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://animus.brinkster.net/temp/Parallax.mov">http://animus.brin=
kster.net/temp/Parallax.mov</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I also put the scene up:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://animus.brinkster.net/temp/Parallax.zip">http://animus.brin=
kster.net/temp/Parallax.zip</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>You can play with the PARALLAX_SCALE =
and=20
PARALLAX_OFFSET nodes to influence the strength of the =
effect.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Ciao, Daniel!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>PS: Looking at the render tree can also =
cause=20
nausea, headaches and/or breathing difficulties :P</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3DBauerOink(at)gmx.de href=3D"mailto:BauerOink(at)gmx.de">Tim =
Leydecker</A>=20
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3DXSI(at)Softimage.COM=20
href=3D"mailto:XSI(at)Softimage.COM">XSI(at)Softimage.COM</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, January 26, 2007 =
10:44=20
AM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: tangent maps</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR></DIV><BR><BR>It seems =
there=B4s all=20
sorts of workflows superior to the<BR>more traditional bumpmap =
implementation,=20
starting with<BR>Ben=B4s ZBump, various ways of Normalmapping and =
last<BR>but=20
not least just tesseleating the mesh to infinity and using<BR>a =
displacement=20
instead - or even a vector displacement.<BR><BR>Problem is, as =
allways, the=20
limited information available<BR>like, "now is that stored in float or =
clamped8bit..."<BR>Pretty hard to get to a point of confidential usage =
then,<BR>or as you=B4ve put it - use it in production=20
asap.<BR><BR>Cheers<BR><BR>tim<BR><BR><BR>----- Original Message ----- =
<BR>From: "Andr=E9 Adam" <<A=20
href=3D"mailto:a_adam(at)49games.de">a_adam(at)49games.de</A>><BR>To: =
<<A=20
href=3D"mailto:XSI(at)Softimage.COM">XSI(at)Softimage.COM</A>><BR>Sent: =
Friday,=20
January 26, 2007 9:58 AM<BR>Subject: Re: tangent maps<BR><BR><BR>> =
I've a=20
whole bunch of programmers around here that got headaches because of =
those=20
<BR>> alpha values; actually we did not find out up to now and my =
personal=20
opinion still <BR>> is it simply is trash (though I'm the only one =
over=20
here with that opinion...). <BR>> Anyone from Soft like to give us =
a=20
hint?<BR><BR>><BR>><BR>> Ben Rogall=20
wrote:<BR>>><BR>>><BR>>> Thanks for forwarding that =
Andre.=20
The hardest part about the vector displacement <BR>>> was =
setting up the=20
tangent space conversion. Well, that and trying different ways =
<BR>>> of=20
exporting objects and mapping the position data. Mental Ray already =
knows how=20
<BR>>> to do multi-directional displacement.<BR>>> =
Regarding the=20
bit-depth of the tangent property, if I read out any of the values,=20
<BR>>> say by checking the SDK explorer and multiply by 255, I =
get a=20
whole number. Btw, I <BR>>> have no idea what is being stored in =
the=20
alpha channel.<BR>>><BR>>><BR>>><BR>>> --- On =
Thu=20
01/25, =3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D < <A=20
href=3D"mailto:a_adam(at)49games.de">a_adam(at)49games.de</A> >=20
wrote:<BR>>><BR>>> *From:=20
*=3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D [mailto: <A=20
=
href=3D"mailto:a_adam(at)49games.de">a_adam(at)49games.de</A>]<BR>>> =
; =20
*To: <A=20
=
href=3D"mailto:*XSI(at)Softimage.COM">*XSI(at)Softimage.COM</A><BR>>>&nbs=
p; =20
*Date: *Thu, 25 Jan 2007 17:32:02 =
+0100<BR>>> =20
*Subject: *Re: tangent =
maps<BR>>><BR>>> Hi=20
Ben,<BR>>><BR>>> thanks for the =
kind=20
words! Very nice work on the displacement=20
mapping!<BR>>> A vertex colour property =
stores=20
float values, not 8bit data, so<BR>>> =20
you're<BR>>> practically lossless when=20
converting back to vectors. The =
smoothing<BR>>> =20
works similar, since it is angle based, but is not connected=20
in<BR>>> any=20
way<BR>>> to the geo approximation or =
the=20
normals. In theory, the normal map<BR>>> =
should=20
be able to compensate cracks in the tangent space,=20
but<BR>>> practically the normal map's =
texels=20
would have to line up<BR>>> perfectly=20
with<BR>>> the polygon edges which is a =
very=20
unlikely occasion. So, as soon<BR>>> as=20
you<BR>>> try to fit a normal map =
texture with=20
its pixel raster onto uneven 3d<BR>>> =
geometry,=20
the tangent space needs to be smoothed to avoid=20
cracks<BR>>> and=20
seams.<BR>>><BR>>> I've attached =
the=20
script to this mails, but really, this is=20
nothing<BR>>> fancy, just a one-time =
creation of=20
null objects pointing in the<BR>>> =20
vector's<BR>>> direction. A compiled =
operator=20
with live-input certainly would be =
way<BR>>> =20
nicer. Oh, and it is slow, be careful with meshes heavier than=20
-<BR>>> say -=20
a<BR>>> thousand polygons, trying it out =
on=20
small objects will be more<BR>>> fun...=20
:)<BR>>><BR>>> =20
Cheers!<BR>>><BR>>> =20
-Andr=E9<BR>>><BR>>><BR>>> =
Ben Rogall=20
wrote:<BR>>> =20
><BR>>> > Andre, very very nice=20
explanation. I've been using XSI =
tangents<BR>>> =20
> recently in experiments with tangent space vector=20
displacement:<BR>>> ><BR>>>=20
<BR>>> <A=20
=
href=3D"http://www.xsibase.com/forum/index.php?board=3D29;action=3Ddispla=
y;threadid=3D28834;start=3D0">http://www.xsibase.com/forum/index.php?boar=
d=3D29;action=3Ddisplay;threadid=3D28834;start=3D0</A><BR>>> &=
nbsp; =20
> It took me a little while to realize I had to do the [0,1]=20
to<BR>>> =20
[-1,1]<BR>>> > interval correction. =
I'm also=20
curious to see whether having only =
8<BR>>> >=20
bits per channel for the tangent vector is enough to avoid=20
jumping<BR>>> > though I haven't seen =
anything obvious yet.<BR>>> =20
><BR>>> > Another issue with =
tangent space=20
is difficulty when you try to get<BR>>> =
>=20
different 3D applications to work with eachother. Once you have=20
the<BR>>> > normal and tangent =
vectors, there=20
are still several ways to<BR>>> =20
determine<BR>>> > your T,B,N space =
depending=20
on which of these vectors you decide =
to<BR>>> =20
> orthoganalize to the others. This choice has to match between=20
the<BR>>> >=20
applications.<BR>>> =20
><BR>>> > I hadn't even thought =
about the=20
smoothing issue you mentioned.<BR>>> Is=20
that<BR>>> > analogous to the normal=20
automatic discontinuity control?<BR>>> =20
><BR>>> > Also is your tangent =
display=20
utility publicly available?<BR>>> =20
><BR>>> >=20
Thanks,<BR>>> >=20
Ben<BR>>> =20
><BR>>> =20
><BR>>> > --- On Thu 01/25,=20
=3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D =
<<BR>>> <A=20
href=3D"mailto:a_adam(at)49games.de">a_adam(at)49games.de</A>=20
><BR>>> >=20
wrote:<BR>>> =20
><BR>>> > *From:=20
**=3D?ISO-8859-1?Q?Andr=3DE9_Adam?=3D [mailto: <A=20
=
href=3D"mailto:a_adam(at)49games.de">a_adam(at)49games.de</A>]<BR>>> =
; =20
> *To: <A=20
=
href=3D"mailto:*XSI(at)Softimage.COM">*XSI(at)Softimage.COM</A><BR>>>&nbs=
p; =20
> *Date: *Thu, 25 Jan 2007 11:20:09=20
+0100<BR>>> > *Subject: *Re: tangent=20
maps<BR>>> =20
><BR>>> > Hi=20
Bernard,<BR>>> =20
><BR>>> > the tangent property in =
XSI is=20
the so called tangent map, or =
tangent<BR>>> >=20
space. Encoded in there you can find a given texture=20
space's<BR>>> >=20
u-direction<BR>>> > (the reason why =
you have=20
to reference a texture projection =
when<BR>>> =20
> creating<BR>>> > a tangent =
property) in=20
3d space (you could call this the =
"texture<BR>>> =20
> mapped" u-direction) on a per sample basis, so we're talking=20
of<BR>>> >=20
vectors<BR>>> > here. In absence of a =
more=20
convenient property Softimage decided =
to<BR>>> =20
> encode the tangents into vertex colors. That means you have=20
a<BR>>> > little=20
bit<BR>>> > of math to do to revert =
them back=20
to vector data: (VC-0.5)*2. This<BR>>> =
>=20
formula stretches the RGB vertex color values, which have a=20
0-1<BR>>> >=20
range,<BR>>> > back to a vector's -1 =
to +1=20
range.<BR>>> =20
><BR>>> > The reason you need a =
tangent=20
space when dealing with normal maps =
is<BR>>> =20
> that a "normal map in tangent space" (there is also an=20
object<BR>>> > space=20
flavour)<BR>>> > stores relative =
information=20
as to where a given normal should =
be<BR>>> >=20
bent,<BR>>> > which after all is what =
bump=20
mapping is all about (bump mapping =
and<BR>>> =20
> normal mappinng are practically the same thing). The=20
lila-blueish<BR>>> >=20
color<BR>>> > in a tangent space =
normal map=20
means that the geometry's input =
normal<BR>>> =20
> should not be altered, where cyan, magenta, etc colours indicated =
a<BR>>> > shift in normal=20
orientation.<BR>>> > This shift, =
which is a=20
relative bit of information as it does =
not<BR>>> =20
> point<BR>>> > to global world=20
coordinates, needs a reference on the=20
object<BR>>> > itself=20
from<BR>>> > which the relative shift =
should=20
be calculated - the tangent space.<BR>>> =
>=20
The<BR>>> > tangent space offers a =
predefined=20
vector for each sample point<BR>>> and=20
is<BR>>> > directly generated from =
the=20
texture projection the normal map =
is<BR>>> >=20
mapped<BR>>> > with onto the=20
object.<BR>>> =20
><BR>>> > I've written a small =
utility=20
that creates little pointers from =
the<BR>>> >=20
tangent space right on the object's surface to better show=20
the<BR>>> >=20
vectors<BR>>> > encoded there. I've =
attached=20
two screenshots which might =
clearify<BR>>> >=20
that a<BR>>> > bit. The first one =
shows a=20
straight spherical mapping, the =
second<BR>>> =20
> one is<BR>>> > twisted. As soon =
as a=20
texture space shows distortions (or =
even<BR>>> =20
worse:<BR>>> > seams), just like the =
second=20
one, tangent spaces become tricky; =
the<BR>>> =20
> samples for a single vertex point in different directions,=20
which<BR>>> >=20
finally<BR>>> > would create =
artifacts during=20
normal mapping. To cope with this<BR>>> =20
issue<BR>>> > the tangent operator in =
XSI has=20
a smoothing value, which basically<BR>>> =
>=20
middles the different sample's tangent vectors using an=20
angle-based<BR>>> >=20
approach.<BR>>> =20
><BR>>> > Since the normal map =
stores its=20
data relative to the tangent =
space,<BR>>> >=20
generation, as done with the ultimapper for example,=20
therefore<BR>>> =20
always<BR>>> > needs to reference it =
during=20
generation to provide correct =
results.<BR>>> =20
> Ultimapper basically marries referenced object curvature from a=20
high<BR>>> > resolution source object =
with=20
the normals of the low resolution<BR>>> =
>=20
source<BR>>> > object and the tangent =
space=20
of the low resolution object.<BR>>> =20
><BR>>> > The Photoshop plugins =
and tools=20
provided by graphics hardware<BR>>> =20
vendors<BR>>> > don't have this kind =
of 3d=20
information available when =
generating<BR>>> >=20
normal<BR>>> > maps from heightmaps. =
They=20
assume that the object the =
generated<BR>>> >=20
normal<BR>>> > map might get mapped =
onto=20
shows an ideal tangent space, =
which<BR>>> >=20
usually is<BR>>> > nonsense. The more =
distorted the texture space on the =
mapped<BR>>> =20
> object is,<BR>>> > the wronger =
(is that=20
english?!) the bump mapping results with such=20
a<BR>>> > textures are. I'd stay away =
from=20
these tools for production work.<BR>>> =20
><BR>>> > Hope that makes some =
sense,=20
cheers!<BR>>> =20
><BR>>> >=20
-Andr=E9<BR>>> =20
><BR>>> =20
=
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D<BR>>> =20
"Show Tangents" / Andr=E9 Adam<BR>>> =
Tool to=20
create null object pointers on an polymesh object's=20
surface<BR>>> to visualise direction in =
a=20
tangent space.<BR>>> =20
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D*/<BR>>><BR>>><BR>>>  =
; =20
function fGetPointer(oObj, oSize){<BR>>> =
var=20
oNull, oDisplay<BR>>> oNull =3D=20
oObj.AddNull();<BR>>> =20
oNull.Parameters("Primary_Icon").Value =3D=20
9;<BR>>> oNull.Parameters("Size").Value =
=3D=20
oSize;<BR>>> oDisplay =3D=20
oNull.AddProperty("Display =
Property");<BR>>> =20
oDisplay.Parameters("wirecol").Value =3D=20
Math.round(Math.random()*1023);<BR>>> =
return=20
oNull;<BR>>> =20
}<BR>>><BR>>> function=20
fGetTangents(oPolyMsh){<BR>>> var eVCs =
=3D new=20
Enumerator(oPolyMsh.VertexColors);<BR>>> =
while(!eVCs.atEnd()){<BR>>> =
if(eVCs.item().Name=20
=3D=3D "Tangents"){<BR>>> return new=20
=
VBArray(eVCs.item().Elements.Array).toArray();;<BR>>> &n=
bsp; =20
}<BR>>> =20
eVCs.moveNext();<BR>>> =20
}<BR>>> return=20
false;<BR>>> =20
}<BR>>><BR>>> function=20
fGetSamplePositions(oPolyMsh){<BR>>> var =
aSamplePositions =3D new Array();<BR>>> =
var=20
ePoints =3D new=20
Enumerator(oPolyMsh.Vertices);<BR>>> =
for(var=20
i=3D0; i<BR>>> =20
ePoints.moveFirst();<BR>>> =20
while(!ePoints.atEnd()){<BR>>> var =
eSamples =3D=20
new =
Enumerator(ePoints.item().Samples);<BR>>> =20
while(!eSamples.atEnd()){<BR>>> =20
if(eSamples.item().Index =3D=3D =
i){<BR>>> =20
=
aSamplePositions.push(ePoints.item().Position);<BR>>> &n=
bsp; =20
}<BR>>> =20
eSamples.moveNext();<BR>>> =20
}<BR>>> =20
ePoints.moveNext();<BR>>> =20
}<BR>>> =
}<BR>>> =20
return aSamplePositions;<BR>>> =20
}<BR>>><BR>>> function =
fShowTangents(oObj,=20
oSize){<BR>>> var oPolyMsh =3D=20
oObj.ActivePrimitive.Geometry;<BR>>> var =
aTangents =3D =
fGetTangents(oPolyMsh);<BR>>> =20
if(aTangents){<BR>>> var =
aSamplePositions =3D=20
fGetSamplePositions(oPolyMsh);<BR>>> =
for(var=20
i=3D0; i var vY =3D<BR>>> =20
=
XSIMath.CreateVector3((aTangents[i]-0.5)*2,<BR>>> =
=20
(aTangents[i+1]-0.5)*2,=20
(aTangents[i+2]-0.5)*2);<BR>>> var vX =
=3D=20
XSIMath.CreateVector3(0, 1, 0);<BR>>> =
var vZ =3D=20
XSIMath.CreateVector3();<BR>>> =
vZ.Cross(vY,=20
vX);<BR>>> vX.Cross(vY,=20
vZ);<BR>>> =20
vX.Normalize(vX);<BR>>> =20
vY.Normalize(vY);<BR>>> =20
vZ.Normalize(vZ);<BR>>> var oM3 =3D=20
XSIMath.CreateMatrix3(vX.X, vX.Y, vX.Z, vY.X,=20
vY.Y,<BR>>> vY.Z, vZ.X, vZ.Y,=20
vZ.Z);<BR>>> var oTrans =3D=20
XSIMath.CreateTransform();<BR>>> =20
=
oTrans.SetRotationFromMatrix3(oM3);<BR>>> =20
=
oTrans.SetTranslation(aSamplePositions[i/4]);<BR>>> &nbs=
p; =20
oTrans.SetScalingFromValues(0.25, 1,=20
0.25);<BR>>> var oPointer =3D =
fGetPointer(oObj,=20
oSize);<BR>>> =20
oPointer.Kinematics.Local.Transform =3D=20
oTrans;<BR>>> =20
}<BR>>> =
}<BR>>> =20
else{<BR>>> LogMessage("aa_ShowTangents: =
No=20
tangents found on object!", =
siError);<BR>>> =20
}<BR>>> =20
}<BR>>><BR>>> =20
=
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D<BR>>> =20
MAIN<BR>>> =20
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D*/<BR>>><BR>>> =20
if((Selection.Filter.Name =3D=3D "object") && (Selection.Count =
=3D=3D=20
1)<BR>>> && (Selection(0).Type =
=3D=3D=20
"polymsh")){<BR>>> =
fShowTangents(Selection(0),=20
1);<BR>>> =
}<BR>>> =20
else{<BR>>> LogMessage("aa_ShowTangents: =
Not a=20
single polymesh object<BR>>> =
selection!",=20
siError);<BR>>> =
}<BR>>><BR>>>=20
=
------------------------------------------------------------------------<=
BR>>>=20
*Join Excite! - <A=20
href=3D"http://www.excite.com">http://www.excite.com</A>*<BR>>> =
The most=20
personalized portal on the Web!<BR>><BR>> ---<BR>> =
Unsubscribe? Mail=20
<A href=3D"mailto:Majordomo(at)Softimage.COM">Majordomo(at)Softimage.COM</A> =
with the=20
following text in body:<BR>> unsubscribe xsi=20
<BR><BR><BR>---<BR>Unsubscribe? Mail <A=20
href=3D"mailto:Majordomo(at)Softimage.COM">Majordomo(at)Softimage.COM</A> =
with the=20
following text in body:<BR>unsubscribe xsi</BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_009C_01C7415E.D8F16B20--
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi