Horde3D

Next-Generation Graphics Engine
It is currently 27.04.2024, 12:45

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 15.06.2010, 11:11 
Offline

Joined: 08.06.2010, 14:17
Posts: 63
If mesh has any rotated UVs, normal maps display incorrectly, as if they were lit from wrong direction. This causes normal maps to looks "shattered" on models with complex UV.

Image
(straight, rotated, randomly rotated UV clusters, all 3 faces look identical in xNormal)

I'm using SVN 245 and colladaConv, diffuse maps look OK.
Any way around this?

EDIT: example file


Attachments:
head.zip [197.87 KiB]
Downloaded 606 times
Top
 Profile  
Reply with quote  
PostPosted: 15.06.2010, 22:20 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
This is certainly a problem with the tangent space basis. Do you use the same tangent space normal map on all three meshes that have different UVs? That will not work as the normal map does no longer match the tangent space basis for which it was generated.

From your notes I see that you use xNormal to generate the normal maps. To get perfect results, the tangent space algorithm used for creating the normal maps must be exactly the same as the one that is used for rendering the model. However, xNormal will certainly have a different tangent space generation algorithm than ColladaConv. So the normals encoded by xNormals may not be decoded correctly in Horde. Depending on how different the algorithms are, the error may not always be noticeable but there can definitely be problems. AFAIK, xNormal has a plugin interface with which you can specify your own tangent space generator. For perfect results, someone would have to write a horde plugin which uses the tangent space generation code from ColladaConv.


Top
 Profile  
Reply with quote  
PostPosted: 16.06.2010, 12:25 
Offline

Joined: 08.06.2010, 14:17
Posts: 63
Wow, didn't expect it to be this complicated.
No problem, object space normal maps solve this quite efficiently. They have their own limitations (software skinning and morphs don't affect lighting (that would probably require changes in the engine)), but no more seams.

Image
And bumpmaps that look like this can't be all bad :D


Top
 Profile  
Reply with quote  
PostPosted: 16.06.2010, 13:20 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
worstplayer wrote:
If mesh has any rotated UVs, normal maps display incorrectly, as if they were lit from wrong direction.
I am still a little confused by what exactly a 'rotated UV' is - can you explain what exactly is rotated, and with respect to what?

I would assume that you have applied some portion of the UV mapping to the surface, and then decide to rotate the resulting triangle-to-texture mapping to rotate the location of that triangle in texture space.

If that is the case, then as long as you re-generate the tangent-space basis afterwards (taking into account the changed UV coordinates), everything should be fine.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 16.06.2010, 23:56 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
worstplayer wrote:
Wow, didn't expect it to be this complicated.
No problem, object space normal maps solve this quite efficiently. They have their own limitations (software skinning and morphs don't affect lighting (that would probably require changes in the engine)), but no more seams.

It is also good to keep in mind that they require considerably more memory, as you can't compress them with a two-component format like 3Dc and as it is not easily possible to mirror UVs when using object space normal maps.

BTW, I happened to see some of your videos on youtube. Really cool stuff you are doing there :)


Top
 Profile  
Reply with quote  
PostPosted: 18.06.2010, 09:49 
Offline

Joined: 08.06.2010, 14:17
Posts: 63
marciano wrote:
It is also good to keep in mind that they require considerably more memory, as you can't compress them with a two-component format like 3Dc and as it is not easily possible to mirror UVs when using object space normal maps.
Yeah, there also can't be any tiling or overlapping (except on completely flat surfaces). On the other hand, they work perfectly across different LOD levels (I tried decimating 200kpoly model to 5000 and there was still practically no distortion) . All in all, using object space for characters and tangent space for levels sounds like a good setup.

marciano wrote:
BTW, I happened to see some of your videos on youtube. Really cool stuff you are doing there :)
Thanks, none of it would be possible without this excellent engine :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group