Author Topic: Help regarding Normal Map/UV Map relation  (Read 11515 times)

0 Members and 1 Guest are viewing this topic.

Help regarding Normal Map/UV Map relation
Hey all, I've been having just a few issues and nagging questions with normal maps and UV layouts.

I've had a small history with this issue. Basically the number one problem is SEAMS. But in this case the seam problem goes into outright lighting issues! Basically if you split a model in half, UV and skin one half of it then normal map it... you will get a NASTY seam right down the middle. One side is highlighted, the other is shadowed. This is a nasty nasty effect that looks just plain horrible. Here is my problem model and one other example I have had in the past:

http://img84.imageshack.us/img84/1843/blizzardnormal.jpg

Compare to the heightmap I converted

http://img31.imageshack.us/img31/8090/blizzardheight.jpg

To the UV Map

http://img227.imageshack.us/img227/4336/blizzardbumpmap.jpg

Contrast to this similar issue

http://img828.imageshack.us/img828/8689/rampanterror.jpg

The problem is a combo UV - Normal map issue. Let's consider this, a normal map adjusts the normals of a model to create an illusion of depth which corresponds to the colors of the UV Map. The ship model has been mirrored across the middle with the engines mirrored side to side and vertically and given the UV map's orientation and arrangement I believe it logical that given the normal map's conversion to the UV's orientation and the model's mirrored body... it seems to have created a mishmash of normal directions, causing what should be shining white to shadow darks. This also reflects in models with lots of UV seams, creating nasty visible seams on models.

I have been working on a partial solution to this and the wings and body SHOULD be resolved... but my worry is the engines, maybe more too. They seem to change in their lighting radically, possibly as a result of being mirrored. This is kind of a scary issue given that the engines dominated a large part of the old UV map, I wouldn't want to UV each engine. Frankly I just don't know what to do. I could resolve these issues one at a time, creating a gigantic UV map to accommodate a properly UV oriented map with few mirrors but I kinda need some advice here...

For one: What sort of UV orientation should I use? If the ship is pointing along the X Axis, what direction in the UV map should the ship be oriented? Pointing up? Or to the sides? Or even down? Are there any solutions regarding the engines? Or possibly eliminating the whole seam issue while retaining the mirroring? Should I Just screw normal maps altogether with this model and save me time by using parallax mapping?
I have created a masterpiece.

 

Offline Thaeris

  • Can take his lumps
  • 211
  • Away in Limbo
Re: Help regarding Normal Map/UV Map relation
I'll regret to tell you that I don't know what to do about the problem, but what model is that? It's really impressive!
"trolls are clearly social rejects and therefore should be isolated from society, or perhaps impaled."

-Nuke



"Look on the bright side, how many release dates have been given for Doomsday, and it still isn't out yet.

It's the Duke Nukem Forever of prophecies..."


"Jesus saves.

Everyone else takes normal damage.
"

-Flipside

"pirating software is a lesser evil than stealing but its still evil. but since i pride myself for being evil, almost anything is fair game."


"i never understood why women get the creeps so ****ing easily. i mean most serial killers act perfectly normal, until they kill you."


-Nuke

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Help regarding Normal Map/UV Map relation
I'll regret to tell you that I don't know what to do about the problem, but what model is that? It's really impressive!

Thaeris: http://www.hard-light.net/forums/index.php?topic=62856.0, http://www.hard-light.net/forums/index.php?topic=61889.0
Be amazed. Vengeance makes awesome stuff.
(´・ω・`)
=============================================================

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Help regarding Normal Map/UV Map relation
I am 95% sure there's a fix for this issue. PM Vasudan Admiral, he'd probably know. Or Water. Or one of those old hands!
« Last Edit: August 05, 2010, 05:47:00 pm by General Battuta »

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Help regarding Normal Map/UV Map relation
Or both, you mean?
(´・ω・`)
=============================================================

 
Re: Help regarding Normal Map/UV Map relation
It's really impressive!
Thanks for the compliment, this tends to happen when you find someone who happened to enrolled in an art college.

I'll PM our Vasudan leadership then, I pray this is a simple fix as I tell ya this UV-Normal map issue has haunted me for years.

I forgot to mention this little dilemma that trying to fix these UVs I had. I UVed with saving space in mind, hence the mirroring but as it is the results are terrible  :shaking:. Now.... I can fix this the old fashioned way but I'd need a bigger UV map. My old UV map is 2048x1024 and was made several years ago, with some time and skill I can probably conserve more space but to fix the normal maps I'd need a biiiiiig UV map... I'm talking 2048x2048, and for a FIGHTER! Now in FPS terms, this is somewhat okay but for a space sim... I am unsure. The fighter model as it is now is 18,000 tris, I have an optimized model in the works which shaved off 2000 tris but.... even at 15,000 tris and a 2048x2048 map.... goodness folks can our beloved FS2Open contain this? Even if aggressively LODed? On that note I have a beast of a capital ship about to hit 50,000 tris and it isn't even done yet.
I have created a masterpiece.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Help regarding Normal Map/UV Map relation
A single 2048^2 map is not a big deal. With the way FSO handles these things, the absolute number of textures has a greater effect than the resolution of the textures.

For reference, there's a model coming up in War In Heaven that has about 86k polies in detail0, the new Hatshepsut weighs in at ~20k polygons.

The engine can handle models at that level of detail just fine, provided the texture count is reasonably low.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 
Re: Help regarding Normal Map/UV Map relation
Okay... on that word just to clarify... if a 15,000 tri model with aggressive lodding (5000 LOD1, 500 LOD2, 50 LOD3 ect) with a single 2048x2048 with all shader and glow textures is okay? Well I feel a bit better now  :D.
I have created a masterpiece.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Help regarding Normal Map/UV Map relation
That will be perfectly fine. I wouldn't recomment using dozens of them in a mission, but they shouldn't pose that much of a risk.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 
Re: Help regarding Normal Map/UV Map relation
I have a hard time telling which direction normal maps are facing but are they facing the opposite direction on each side?

If so then you must either map both sides individual or split them (resulting in smoothing problems you complained about).  Objects with attached vertices (the main hull in this case) cannot share uv space.  The wing pods (provided their seperate subobjects) can share the uvspace since they're not connected.  Unforunately it's a pain in the ass and bad for texture space.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 
Re: Help regarding Normal Map/UV Map relation
I have a hard time telling which direction normal maps are facing but are they facing the opposite direction on each side?

If so then you must either map both sides individual or split them (resulting in smoothing problems you complained about).  Objects with attached vertices (the main hull in this case) cannot share uv space.  The wing pods (provided their seperate subobjects) can share the uvspace since they're not connected.  Unforunately it's a pain in the ass and bad for texture space.

It is most likely possible that they are opposite but when I look at it they don't LOOK opposite. On the secondary example I showed, a character I called Rampant, had opposite normals along the seam down his back and shoulders. I do indeed believe mapping both sides may be my only remaining choice for best normal map presentation at this point.
I have created a masterpiece.

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Help regarding Normal Map/UV Map relation
I think a workaround to this problem may have been implemented in FSO's rendering engine.  Not sure about that though.

 

Offline Water

  • 210
Re: Help regarding Normal Map/UV Map relation
it seems to have created a mishmash of normal directions, causing what should be shining white to shadow darks. This also reflects in models with lots of UV seams, creating nasty visible seams on models.

For one: What sort of UV orientation should I use?
UV orientation is not important. The normal map uses whatever uv's you provide.

The simple way to sort the mirror seam problem is to not have the mirrored parts meet.

Other than that mirrored parts shouldn't cause any problems. Any issues in that area may be an export problem rather than a normal map problem. If you pm an obj and normal map I can send a different version back to verify the issue.


 
Re: Help regarding Normal Map/UV Map relation
I did some tests, seems like orientation might not be the big cause I thought it was, but what still stumps me is why the lighting on some parts of the model are so off. The model hasn't been exported or anything. I found a small problem was an exaggerated normal map setting but it hasn't fixed a lighting issue and could potentially look really odd ingame.

notice the highlight on the normal mapped wing is reversed that of the non normal mapped. Well maybe not 'reversed' but why is it not visible. Also notice the thing attaching the gun to the wing one the right wing (its right) is shiny bright but moot dark on either side.



EDIT:
Well in any case, to fix the central seam problem I'll have to remap the UVs some. The biggest plus to this would be some more space to work with and all. Well thanks for your feedback in any case.
« Last Edit: August 06, 2010, 08:28:12 am by Vengence »
I have created a masterpiece.

 
Re: Help regarding Normal Map/UV Map relation
I figured I'd turn this into a progress blog or something. For all I know some of those who are new to UVing may find this entertaining watching me suffer burning in UVW Unwrapping hell.

In my line of work, UVing is a half boring, half fun process. Boring in that you don't see any effing progress. Fun in that it is simple to do. Finally frustrating in that it takes so long to do. Here is the progress on the new UV Map



The new feature to this UV map over the previous one is that it is going to be 2x the size of the previous one so I won't be drawing lines 1-2px thin anymore. Also with darned luck I may be able to stuff most of the stuff into the map. But at this rate I am unsure. The good news is that I have the vast majority of VISIBLE space unwrapped onto the UV map with 1/4 space remaining for everything else. The bad news? All that remaining space is left for the engine pods, missiles, wing cannons, and nose cannons. All of which are some of the most polygon intensive and detailed parts of the models.

The key to making a good UV map is putting as much space as possible to what is very visible and going small on small details that aren't likely to be seen. As indicated, the main hull of the fighter occupies almost 2000 pixels in height and width. Meaning the body's resolution will most certainly be as sharp as possible. That is good ya? I hope so. The worry I am having is stuffing the rest of the model in that tiny space.
I have created a masterpiece.

 

Offline Water

  • 210
Re: Help regarding Normal Map/UV Map relation
notice the highlight on the normal mapped wing is reversed that of the non normal mapped. Well maybe not 'reversed' but why is it not visible. Also notice the thing attaching the gun to the wing one the right wing (its right) is shiny bright but moot dark on either side.
I have seen this happen  in a pof before, in a Max exported model. The highlights were on the opposite side to where they should be. It wasn't the normal map. You need to talk to some Max people first to solve it. I'm not sure how you save normals the wrong way in Max, but start there.


 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: Help regarding Normal Map/UV Map relation
Simply put, FSOpen's normal map shader is doing it wrong. I encountered a similar problem when I was implementing tangent-space normal mapping in a program of my own, and I think I know what the issue is...

For everyone else who doesn't, tangent-space normal maps (the kind FSO uses) work like this:

There's a normal vector (fairly straight forward, it's the direction "out" from the surface, possibly using the per-vertex defined normals, i.e. smoothing info. I don't know if FSO does that or not. Next, depending on the terminology you use, you could say there are 2 tangent vectors, or a tangent vector and a bi-tangent vector. These are basically vectors in the plane of the polygon which correspond to the u- and v- texture axes. Basically they're the directions in which u and v increase the fastest; the gradients of u and v with respect to position.

These vectors are normalized (meaning they're scaled to have a length of 1), and the shader lights the object as though its normal vector were the linear combination of these 3 vectors with the coefficients for the 1st tangent, 2nd tangent, and normal vector being the reg, green, and blue components of the normal map (of a traditional "blue" normal map, of course, not the converted green/alpha maps FSO uses), respectively.

I suspect the problem is this:

The 2nd tangent vector (sometimes called the bi-tangent) is often perpendicular to the 1st tangent vector; if the texture is not skewed at all, they are exactly perpendicular. Thus, a program can get away with using a cross-product (the cross product of two vectors is a vector guaranteed to be perpendicular to both of the two input vectors) rather than doing the potentially more expensive calculation necessary to compute 2 tangent vectors. However, if a model is mirrored (with accordingly mirrored texture coordinates), the direction of the cross product vector is opposite of what it is on the other side.

So really the program (or the vertex shader) just needs to calculate both tangent vectors.

I'll bring this to the attention of someone on the SCP, maybe it can be fixed and in the nightly builds soon.

 
Re: Help regarding Normal Map/UV Map relation
Indeed the model is mirrored, which is pretty much the problem. But I have little other choice but to submit to that problem. In 3DS Max I have 2 ways of trying to reset normals. There is reapply the smooth modifier which will allow you to set the normals on the model. Then there is Reset X Form which is handy for fixing nasty issues and transforms. I've tried this before, and same result on the model. I would UV both sides of the wing but that will eat up too much UV space.
I have created a masterpiece.

 

Offline Water

  • 210
Re: Help regarding Normal Map/UV Map relation
Mirrored uv's from Blender don't cause the issues you are seeing. Try this, export the model to obj, re-import to Max and you'll find the lighting issues have probably changed. 

Vengence, the lighting problems are in Max? or FSO?

 
Re: Help regarding Normal Map/UV Map relation
Well the renders I supplied aren't exactly placed in a black background, so Max.

I tried the export to OBJ, did nothing. Well this could... hopefully just be a max problem. My new UV map won't have any seams but it will still likely have that reverse lighting issue if I am unlucky. In any case time will tell.
« Last Edit: August 06, 2010, 09:34:52 pm by Vengence »
I have created a masterpiece.