XSI: Problem with normal mapping & multiple uv-sets

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
Priate_Tobey
Gnoblar
Posts: 11
Joined: Tue Mar 14, 2006 9:00 pm

XSI: Problem with normal mapping & multiple uv-sets

Post by Priate_Tobey »

Hi,
I like to have multiple uv-sets in my models. Therefore I made two texture projections in XSI. One cylindrical, the other unique uv, for rendermaps.

First Question:
When I export my model, with generate Tangents options, I don't think that they are actually created. The debugger shows, that

Code: Select all

pMesh->buildTangentVectors(src, dest);
is never called. That could make somehow sense, since

Code: Select all

if (pMesh->suggestTangentVectorBuildParams(src, dest))
returns whether tangents are already present or not. So it might be better

Code: Select all

if (!pMesh->suggestTangentVectorBuildParams(src, dest))
Does that make sense?

Second Question:
Now to the really weird stuff. When I generate tangents, the result still looks wrong. The tangents should be in TEXCOORD2 since 0 and 1 are the normal uvs. I adapted the shader to reflect this. The result looks messed up (Picture2)
But when I turn of generate tangents now, and export the model again, it suddenly looks right!? (Picture 3). And the fun part, when I reboot the computer (or sometimes also when displaying other graphics) the tangents are lost again and it looks like Picture 1. It drives me crazy :(
Are this texcoord somehow cached in the graphics card?!
I am kind of desperate...

I included the material/shader/declaration links at the end of this post.

Thanks everybody for the help!

Some screenshots:
Picture 1:
Image
Picture 2:
Image
Picture 3:
Image

Resources:
Cg-Shader

Program decl

Material
Post Reply