Author Topic: Normal map shared across differently oriented polygons  (Read 11022 times)

0 Members and 1 Guest are viewing this topic.

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Normal map shared across differently oriented polygons
Just because Results = Looks Great in a modeling program (Such as Max, Blender, whatever) doesn't mean that FSO isn't the problem.
The tests I did were done in Blender then looked at in FSO.
What do you think did i do? What you are saying right now is that you completely and utterly ignored my main post which demonstrated the thrice damned problem properly.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Normal map shared across differently oriented polygons
id get around this issue with a second mapping channels for uv space. you keep your regular mapping for diffuse textures where you could overlap to your hearts content. in the second channel no two polygons that share the same material are allowed to overlap. normals from the tile map would be combined with the surface normals in the geometry, transformed based on the projection data for the second uv map, and then new normal maps would be generated based on that data, and those maps would be use for normal maps.

this kinda thing ocould probibly be done in max, but you would need support in pof for extra mapping channels. the second uv map set could be generated automatically by max. it might be possible to do the process in the game and stick the new uv projections and generated normal maps in the cache folder, thus no new data need be added to pof. it would allow more effitient use of diffuse textures while supporting flawless normal maps on even heavily tiled and overlapped models.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Normal map shared across differently oriented polygons

Well, it would also be nice to know what POF format stores in terms of readable features from the UV channel to begin with, before we start looking at increasing channels.

And frankly, I'd rather we just start being able to load DAE and be done. But that's probably just me.

And still doesn't address the issue at hand. How are we getting conflicting results here? Started with one person saying it's not working (and everybody saying it's doing what its' supposed to be doing) to now being reproducible by another person (swinging the vote now to 2 people exampling it as there being a problem) to now being 2-to-1 about whether or not we actually have a problem to begin with.

So, I think we need to formulate some sort of standardized way or methodology for "How can this be Reproduced Unilaterally" and "How to Avoid this from Happening Unilaterally" and seeing where that get's us.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Normal map shared across differently oriented polygons
i figure it could be done procedurally in engine without needing to provide extra mapping data. youd need an algorithm for unstacking polygons from the uv map, then re-arange the polygons space them out in a square area, then scale to fit in map space. this uv map channel would be cached externally from the pof file (thus no pof changes neccisary). the next step is to bake the tile normal map into a new texture, while compensating from the variations caused by the surface normals. the game engine would instead of using the normal map that goes with the tile texture, and the mapping channel from the pof, it would used the cached mapping channel and texture. you wouldnt do this for every texture, you would need some way to flag textures that this process should be done on.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Normal map shared across differently oriented polygons
i figure it could be done procedurally in engine without needing to provide extra mapping data. youd need an algorithm for unstacking polygons from the uv map, then re-arange the polygons space them out in a square area, then scale to fit in map space. this uv map channel would be cached externally from the pof file (thus no pof changes neccisary). the next step is to bake the tile normal map into a new texture, while compensating from the variations caused by the surface normals. the game engine would instead of using the normal map that goes with the tile texture, and the mapping channel from the pof, it would used the cached mapping channel and texture. you wouldnt do this for every texture, you would need some way to flag textures that this process should be done on.
so, instead of examining the pof format and the converter, and doing something that'd fix this, you propose a totally roundabout way that would A) increase memory useage utterly needlesly, B) be prone to breaking on any burp, C) its just WRONG on so many levels its insane.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Normal map shared across differently oriented polygons
i figure it could be done procedurally in engine without needing to provide extra mapping data. youd need an algorithm for unstacking polygons from the uv map, then re-arange the polygons space them out in a square area, then scale to fit in map space. this uv map channel would be cached externally from the pof file (thus no pof changes neccisary). the next step is to bake the tile normal map into a new texture, while compensating from the variations caused by the surface normals. the game engine would instead of using the normal map that goes with the tile texture, and the mapping channel from the pof, it would used the cached mapping channel and texture. you wouldnt do this for every texture, you would need some way to flag textures that this process should be done on.
so, instead of examining the pof format and the converter, and doing something that'd fix this, you propose a totally roundabout way that would A) increase memory useage utterly needlesly, B) be prone to breaking on any burp, C) its just WRONG on so many levels its insane.

i cant vouch for my sanity, but i dont see memory usage being that bad. memory usage would be about one extra uv map and one texture worth, and is only done on certain textures. no different than if we had multiple mapping channels (which is something many people want and might, in the distant future, be implemented). the initial tile normal map is only ever used to generate another normal map, then it can be unloaded and the other map may be used instead.

then if the pof format is ever amended to support more mapping channels, you could just import the uv map that the game spewed out back into the pof, and continue to use the baked normal map.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Water

  • 210
Re: Normal map shared across differently oriented polygons
What you are saying right now is that you completely and utterly ignored my main post which demonstrated the thrice damned problem properly.
Um... no

You demonstrated the problem in FSO. It's real.

After testing I think the problem is PCS2. It has to handle a wide variety of of mesh quality, and it optimizes the mesh, even if you don't want it to.

If the polys are separated or in different sub-objects it works well. However Zookeeper still has the problem even with the polys separated. So there are several choices. First is to export from Max to obj and re-import then create the pof. If that solves the problem then there is a secondary Max issue. Which is a separate but related problem.

Zookeeper if that doesn't work you may need to post the dae/pof/normal map.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Normal map shared across differently oriented polygons
Here's the testing model. LOD0 has the model with the arrows pointing in the same direction where everything works, and LOD1 has a model with the arrows of the centermost quads all pointing in different directions. The included .dae file is the one which I got when I exported the model from Max. I'm not including all the dozen or so different variations I've tried, since they all still exhibit the exact same glitch.

In case anyone would suggest it; I've also tried Spicious' latest build, which didn't help.

EDIT: And the .png's work just fine. Really. Please don't say anything about how one shouldn't use them.

[attachment deleted by ninja]

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Normal map shared across differently oriented polygons
In case anyone would suggest it; I've also tried Spicious' latest build, which didn't help.
Confirming this. For future reference the build is PCS2 Alpha Release (Feb 18 2011 19:14:09).

Quote
EDIT: And the .png's work just fine. Really. Please don't say anything about how one shouldn't use them.
i will :p
« Last Edit: February 18, 2011, 06:06:25 pm by pecenipicek »
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Normal map shared across differently oriented polygons

Just don't use 16bit PNGs. Apparently those DON'T wor, but I'll be making sure they do when I upgrade libpng which should be within the next couple of weeks. I hope.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline Water

  • 210
Re: Normal map shared across differently oriented polygons
It tested ok for me, both detail0 and 1

Stab in the dark here, would you have a nVidia card?


 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Normal map shared across differently oriented polygons
It tested ok for me, both detail0 and 1

Just so there's no room for error here: are you sure? It looks ok in your screenshot to me too, but the glitch isn't very obvious from all angles. I've found angles like this to be the quickest way of seeing if anything's wrong.

Stab in the dark here, would you have a nVidia card?

Yes, I do, an n7600GS. :nervous:

[attachment deleted by ninja]

 

Offline Water

  • 210
Re: Normal map shared across differently oriented polygons
Re-checked, it's uniform viewed from each corner so that just one triangle of each diamond is visible, they all line up.

Had read about a normal problem around November, when I re-read it, it turned out to be a bit more severe than your one so it may not be related. It was fixed by updating to the latest nVidia drivers.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Normal map shared across differently oriented polygons
I checked, and yes, it looks like PCS2 does weld vertices; I saved the model to a .pof, opened it, saved as a .dae and imported it back to 3ds Max, and indeed the vertices had gotten welded at some point.
PCS2 doesn't distinguish between one vertex and two vertices at the same point.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Normal map shared across differently oriented polygons
Firstly, using FSU shaders I can now get the normal map to work right as long as the quads don't share vertices, even if their vertices are in the same points. I'm not sure what has changed; this isn't the first time I've tried this set of shaders and it doesn't matter whether I use the latest PCS2 build or one which is older than this thread. Confusing.

I checked, and yes, it looks like PCS2 does weld vertices; I saved the model to a .pof, opened it, saved as a .dae and imported it back to 3ds Max, and indeed the vertices had gotten welded at some point.
PCS2 doesn't distinguish between one vertex and two vertices at the same point.

Secondly, I can't reproduce the above anymore (regardless of which PCS2 version I use). :confused:

  

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: Normal map shared across differently oriented polygons
[/lurk]

Here's a bit of info I came across during an attempt to fix FSO's normal mapping implementation:

The tangent-space info is not stored in the POF, but rather the IBX (so it's generated at runtime if there's no cached data for it). It is stored as 4 numbers --- 3 for one of the tangent vectors, and a 4th which I believe controlled whether to flip the second tangent when it was computed. IIRC the second tangent vector is computed in the vertex shader.

[lurk]