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

0 Members and 1 Guest are viewing this topic.

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Help regarding Normal Map/UV Map relation
It's good to see you back on with that amazing fighter. :D

 

Offline Water

  • 210
Re: Help regarding Normal Map/UV Map relation
Try a test export to pof, if there are no lighting issues, then you  are probably right about it being just a Max issue. Blender exports mirrored normals fine, but displays them inverted within Blender.
« Last Edit: August 06, 2010, 09:45:44 pm by Water »

 
Re: Help regarding Normal Map/UV Map relation
Inverted? you mean backwards? Well Max also has a normal tool which can be used to invert normals. Perhaps I should give that export a try? Granted the model isn't born with holes in it... but that is basically what the normal tool does.
I have created a masterpiece.

 

Offline Water

  • 210
Re: Help regarding Normal Map/UV Map relation
Inverted? you mean backwards? Well Max also has a normal tool which can be used to invert normals. Perhaps I should give that export a try? Granted the model isn't born with holes in it... but that is basically what the normal tool does.
I mean the mirrored uv have their bumps inverted in Blender not the polys. The same thing can be achieved by inverting the green channel on the normal map.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Help regarding Normal Map/UV Map relation
I've also sometimes had this problems with normal maps. I got rid of it by not welding the mirrored parts together in the UVW editor. Map the offending parts separately, then do the mirroring manually in the UVW editor and stack the parts manually on top of each other, but don't do the "Weld selected" operation.

NOTE: I'm only referring to the "weld" operation in the UVW editor, not the geometry editor... the geometry stays perfectly solid, no detached polygons.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 
Re: Help regarding Normal Map/UV Map relation
You know what? You may have a point Fishguts. I'll give it a go when I finish laying out the UVs before mirroring, then I'll remap the problem parts.
I have created a masterpiece.

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: Help regarding Normal Map/UV Map relation
Water's quite correct - the issue here is with 3ds, not your normal maps or geometry. Do a test conversion and see how it looks in FSO, because taylor figured out how to get FSO to flip the normal depth on the mirrored side already, which is pretty good. Not totally perfect as some lighting directions you'll still see the seam, but you won't get that inverted normals effect on one side. :)

I'm not a max user but apparently this doesn't happen with the symmetry modifier? Is that what you're using?
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 
Re: Help regarding Normal Map/UV Map relation
No I just mirrored the model. And I think I have witnessed the effect in FSO. Indeed there is still a slight seam but it is nowhere near as pronounced as in max. This makes me cringe to think I spent all these hours making a new UV map to replace the old one XD. In any case, it is good to know this is a mostly Max issue. Saves my hide a good bit. Least I hope. In any case the final layout should look even better.... if I am lucky. It is getting quite cramped. I may have to create a second texture... which isn't such a good idea.

I think this is good progress except for one nasty issue. The engine and missile rack is most likely going to suck up the last of the UV space, no room for canopy or the fuselage cannons.


EDIT:
I just put a few more things in, yup.... no more room. I gotta either shrink some stuff or make a second map.
« Last Edit: August 08, 2010, 01:50:41 pm by Vengence »
I have created a masterpiece.

 
Re: Help regarding Normal Map/UV Map relation
Just a light bump for progress

Image is in 1080p HD so I'm not displaying the pic here (It'd eclipse the forum!)

http://img72.imageshack.us/img72/5434/blizzardrender.jpg

The only problem I made was again due to space issues... I really hope you folks are right about FSO eliminating the normals issue... Now the engines have that same seam issue, but up and down this time. Blah... well I hope this works.
I have created a masterpiece.

 

Offline Angelus

  • 210
  • The Angriest Angel
Re: Help regarding Normal Map/UV Map relation
Just a light bump for progress

Image is in 1080p HD so I'm not displaying the pic here (It'd eclipse the forum!)

http://img72.imageshack.us/img72/5434/blizzardrender.jpg

The only problem I made was again due to space issues... I really hope you folks are right about FSO eliminating the normals issue... Now the engines have that same seam issue, but up and down this time. Blah... well I hope this works.


Looks good, that ship.  :yes:

And you can use the lvlshot tags for images, just qoute me to see how.

while ( !asleep)     |     Building a Warmachine for FreeSpace: Chronicles of a dark Age        |       My WIP's                                 
{Eights++}

 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: Help regarding Normal Map/UV Map relation
Bleh. I tried to code a fix, but got frustrated and gave up.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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.

when taylor was first writing up the normalmapping shaders we had a semi-longish conversation about this, at least what was being done 3 years ago was that a binormal vector was sent to the shader then the tangent was made from this (and the normal), i tried arguing that he should be sending both to the shader but all of the example code he was finding did not do this so I don't think I ever convinced him this was the right way to do it. I might have convenced him to add a 'handedness' scalar that would correct inverted normals, but it still would not have handled scewed UV space well. in any event this was three years ago, i have no idea how things are being done now and this is probably unrelated to how things are being done currently.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Help regarding Normal Map/UV Map relation
What a necro  :). Well you have no worries now since Freespace 2 handles this even better than 3DS Max. This is a pic I have located on my laptop. I'm away from the computer with the source files.



The issue with mirroring and normal maps WAS unavoidable. Really the only way to avoid it is through clever mapping and technique. But in Freespace 2 those effects are highly minimized, thank goodness.

Now I am no fan of locking topics, but considering the end results worked perfectly thanks to the amazing FSOpen engine, AND a great release fighter, I think we can consider this topic ended  :). Unless of course... there are questions to be asked? Feel free, but I suspect the topic has reached an end.
« Last Edit: December 09, 2010, 12:13:24 am by Vengence »
I have created a masterpiece.

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Help regarding Normal Map/UV Map relation
I don't think many people have noticed that there's a release for it on FSMods yet, you should spotlight it in-game some and give it some attention. :D

  
Re: Help regarding Normal Map/UV Map relation
I did sort of promote it in a topic with the eponymous title of "[Release] Blizzard Fighter" and showed a good bit of ingame screens. I only have the feeling that if I promote it again I'll be spamming XD. How shall I promote it further without sounding like I am an attention nut  :p?

Whoops... then again I didn't have any in game actiony pics... Well poo looks like I'll have to cook some up... oh wait I have pics  :)

« Last Edit: December 10, 2010, 10:04:41 am by Vengence »
I have created a masterpiece.

 

Offline Black Wolf

  • Twisted Infinities
  • Global Moderator
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Help regarding Normal Map/UV Map relation
I did sort of promote it in a topic with the eponymous title of "[Release] Blizzard Fighter" and showed a good bit of ingame screens. I only have the feeling that if I promote it again I'll be spamming XD. How shall I promote it further without sounding like I am an attention nut  :p?

I think I can help with that :)

Quick question though, are those normal maps in the existing DL? If not, reckon you could update it? They're really amazing.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 
Re: Help regarding Normal Map/UV Map relation
Those should be the normal maps. I really only had two versions. One made from CrazyBump and one from Photoshop. The CrazyBump version was too.... bulging so I stuck with the photoshop's clean lines. Yes the final model should have those normal maps.

If it doesn't appear right it is probably the map I made in FRED. There are 3 suns, one is on the opposite side soooooo.... hehe yeah.

I just saw the post on the front page too. Thanks!  :D

Edit: If you wish, I can give you a small tutorial about some normal map techniques, but honestly my methods aren't too different than normal ones. All it was really was a ton of effort to make something good.
« Last Edit: December 10, 2010, 12:58:15 pm by Vengence »
I have created a masterpiece.