I'm back, so Bengal first, spirit?

Discuss the Wing Commander Series and find the latest information on the Wing Commander Universe privateer mod as well as the standalone mod Wasteland Incident project.
Post Reply
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

LOL, Spirit, are you going to try and build one of these? :D

Ehm.. Spirit, BTW; are you, or have you been, working on the game flow and mission/dialogue files for WC1? Multiplayer is alright, but not necessary for WC1; and the Hornet and Bengal WILL be finished, believe it or not :D, and the rest of WC1 ships will come after that, and hopefully a lot faster than these first experiments. And in the meantime, for game testing, you could take any ship, anyhow, copy and rename it, for the time being. Just thought I'd bring it up because you used to ask "what needs to be done?"

Okay, I'm starting to get the hang of xNormal. Got my parts all in separate layers and I'm optimizing the baking of normal map for each piece separately. Some examples,

Image

Image

Image

What I'm curious is, what by, where and/or when are tangents added to the vertices? Are they exported by Blender by default? Are they added by xNormal? If the latter, do I need to "save meshes" in xNormal and re-import them to Blender? And what's going to happen to the tangents in areas where I have single or double folding? Liky the boxy thing the central gun attaches to: It has vertical and horizontal symmetry, which I've dutifully exploited (see the L-shaped piece in the second pic?)
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Usually, tangents are exported as an auxiliary texture coordinate set.
Blender not having multiple UVs yet, I bet it doesn't support pre-specified tangents. When you don't have them pre-specified, they can be computed. Thing is, little details may make certain cases ambiguous and some bakers resolve it one way while some others do it another way (hence the usefulness of exporting the tangents).
I'm not sure if bakers support exporting tangents... perhaps they rely on you using the same algorithm.

Re. double folding: trouble. You'd have to split those vertices, first, and next every feature in the normalmap needs to be symmetric too. Don't worry - just pick one of the possible outputs, things won't look that bad even if there are minor inconsistencies, that's the beauty of tangentspace, and the hardship of baking in tangentspace.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

I'm just thinking... If the GI uses tangents already, and normal mapping needs tangents also, then normal mapping should be in the same UV-mapping as GI. Otherwise you need two set of tangents, in addition to two sets of UV's...
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

I think I use tangents for GI, but I could use generated tangents - I only use them to simplify arithmetic. Phong (non-normalmapped) shaders do that, the vertex shader itself computes the tangentspace.
Let me check that.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

I find that hard to believe... How would the shader know which way the texture points? It would need to check neighboring vertices, and where they map to, in the texture... Unless the "triangle setup" hardware does that behind the scenes... But if that is so, we should never need to export tangents... Something doesn't square up... (unless it "triangles up" :))
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Hehe... I take a random (but stable) direction and apply Gram-Schmit orthonormalization. The resulting tangent isn't good for normal mapping, but it works for mostly everything else.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Well, maybe we should unify normal map with GI, then; export decent tangents once and use them for both. Spare you however many instructions it takes to compute Gram - Schmit...

Tell you another reason why I'm suggesting this. Generally speaking, I'm a bit disappointed at normal mapping. Sure, it makes things look more real, but it also introduces a lot of artifacts. And not just with my sorry assed attempts at xNormal-ing; I'm talking about the examples that come with xNormal, as well. Paralax is basically a compromise between the artifact that normal mapping without it IS, and the artifacts that paralax itself creates. Piece-wise normal map baking also introduces artifacts, since, at the edges of the pieces, a lot of rays miss their target. To make a long story short, I think a non-overlapping, single shot, low rez normal map just to get a smoother shading would be fine, and the way to go, rather than try to use it as a tool for adding detail.
More to the point, we need to get a simple way of having a normal map baking that doesn't take rocket scientists to produce, or else it will never become a standard procedure that all modellers and texturers will use. Most of them don't know what the spec map color does, let alone going to be persuaded to produce PRT bakings. The instructions for how to produce a normal map should fit in one page in the wiki. And by one page I mean, no scrolling. To do normal map baking in the overlapping texture UV the first thing one has to do is get rid of all but one copy of each of the geometries sharing a UV island. I'm not sure I'd understand my last sentence if I hadn't wrote it... :D

The procedure should be like
1) Select the mesh
2) Shift D to duplicate it.
3) Alt S to shrink all polygons along their normals, enter -0.05
4) P to separate the shrunk mesh
5) In object mode, select it, attributes, subsurf, 2, 2, apply
6) Export both meshes to wavefront obj (high quality normals, triangulate, no free edges, no rotation, no materials). For the low poly mesh, check the UV button; for the high poly mesh don't.
7) xNormal instructions.
Done!
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

It is a complex procedure.
But yes, it might be a whole lot easier with non-overlapping unwrappings.
I could try to do the magic necessary to support it in the shaders, even if it means having more passes.
You could try and see how it goes with non-overlapping mappings.

BTW: There is a simple way of doing normalmaps, and it's the artsy way: create a heightmap, use a tool to convert heightmaps to normalmaps (there are tons), and that's it. You won't get high-to-low poly conversions like that, but you get a very decent tool (the high-res hornet was done like that, for instance, and see how it looks). A low-poly version could be done like that.

Parallax, yes, is very hard to master. Once you get things right, it is really impressive. The trick, I think, is to make sure you don't overly alter silhouettes with your heightmap. Whenever you do, it shows. Inner silhouettes are acceptable, but the general outline should remain.

BTW: Gram-Schmitt takes very little. IIRC, 3 dp3 + 3 normalizations.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

No, not if it means more passes; I thouht it would be *easier* for you.

So, I got a tentative normal map:

Image

Problem is, it shows seams at all the mirroring lines. And I split the vertices, and yet the darkish bands are still there all the same.

Image

So, I've put a package together for you, in case your paralax shader can deal with it while xNormal can't. Hold on, let me finish it off...
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Here we go:
http://deeplayer.com/dan_w/WCUweap/meshes.7z
... there are two, one with each UV mapping.
http://deeplayer.com/dan_w/WCUweap/textures.7z
Not sure if the PRTP/PRTN are corrupted in the zip; they won't open
from it. So here they are:
PRTP:

Image

and PRTN:

Image

Here's also a mask, in case you need one:

Image

The diffuse and specular textures are just material bakings plus noise, just for now, for a quick test.
DualJoe
ISO Party Member
ISO Party Member
Posts: 387
Joined: Tue Mar 21, 2006 2:37 pm
Location: Netherlands
Contact:

Post by DualJoe »

Press F1 before making a screenshot with xNormal to get rid of the UI.

The easiest way to avoid problems at the seams/mirroredge is to keep those neutral blue. I just noticed that you used only half the barrel for normalmapping. It think it will work better if you use a complete barrel or use flat surfaces at the edges.

Worse than the problem at the seams though is the lack of detail in the normalmap.
xNormals maps are so blurry that you're better of letting it do a highres-version and then scale that one down. I prefer ATINormalmapper and BRaybaker for details because they are far less blurry and use xNormal for the heightmap(high->low) and crude features.

Come to think of it. Why don't you paint the map by hand? Your greebles are simpler than mine. You only have to paint one indentation and then you can copy-paste it all over the place.

On the point of mirroring:
Making a mirrored uv-texture is very difficult. You've given me one hell of a first texture-job. It was mainly because of the seams and mirroredge that I ended up painting the entire heightmap by hand, it gives you absolute control over those difficult areas.

BTW have you any idea how difficult it is to make a mirrored texture not look mirrored?
I thought the whole idea was that those mirrored textures and models would be a big plus resourcewise. If it costs that much on all fronts what's the point of doing it this way?
spiritplumber
Developer
Developer
Posts: 1831
Joined: Mon Mar 07, 2005 10:33 pm
Contact:

Post by spiritplumber »

Offtopic, but: Try to take those last three pictures and make a little flash animations of them alternating and rotating, then project it somewhere....


BIZARRO VISION! :shock:
My Moral Code:
- The only sin is to treat people as if they were things.
- Rules were made for people, not the other way around.
- Don't deceive. Real life is complicated enough.
- If all else fails, smash stuff.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

DualJoe wrote:I thought the whole idea was that those mirrored textures and models would be a big plus resourcewise. If it costs that much on all fronts what's the point of doing it this way?
It does reduce memory requirements a great deal.
Apparently (I hadn't realized), it also increases texturing difficulty tenfold.
:(

BTW: The seams on the normalmap look like xNormal bugs - they can be photoshopped out, it's not the technique, it's the baker, I can see the glitches on the texture with the naked eye.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Dual wrote:The easiest way to avoid problems at the seams/mirroredge is to keep those neutral blue.
Sorry, what's "neutral blue"?
I just noticed that you used only half the barrel for normalmapping. It think it will work better if you use a complete barrel or use flat surfaces at the edges.
I used a full barrel high detail under a low detail half barrel.
Worse than the problem at the seams though is the lack of detail in the normalmap.
xNormals maps are so blurry that you're better of letting it do a highres-version and then scale that one down. I prefer ATINormalmapper and BRaybaker for details because they are far less blurry and use xNormal for the heightmap(high->low) and crude features.
Today is packing day; I shouldn't even be posting. Company is moving and I haven't even started packing my office yet. And my project for work is ultra late, so I probably won't even try Braybaker and ATI NM until probably january. I don't have that much detail tho.
Come to think of it. Why don't you paint the map by hand? Your greebles are simpler than mine. You only have to paint one indentation and then you can copy-paste it all over the place.
No idea what you mean. How does one do that? Oh, you mean for the gun barrel? That's not very important. The middle section of the guns will be pretty dark. Hardly noticeable. And I can paint the indentations black. You'll never see the gun from very close, in-game, anyways.
spiritplumber wrote:Offtopic, but: Try to take those last three pictures and make a little flash animations of them alternating and rotating, then project it somewhere....
You scare me, spirit; are you all right? :)
BTW, the PRTP and PRTN do look funny, but what they are is special bakings for Klauss' shaders. Each is really what the texture looks like if the model was white, and was illuminated by 3 colored lights: Red, Green, Blue, coming from the x, y and z axes.
klauss wrote:BTW: The seams on the normalmap look like xNormal bugs - they can be photoshopped out, it's not the technique, it's the baker, I can see the glitches on the texture with the naked eye.
I can't see them, but if you say so... Could you do it, klauss? I gotta get off line now for some days.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Finally, I got my computer here at home, Internet and everything. I'll see if I can remember what file was what, though... what a mess! (BTW, if I don't say any of the socially expected seasonal uterances, don't take it personally; I just don't believe in any of that crap anymore than I believe in santa.) Anyways, I remember I was having trouble with normal mapping and was about to take a look at other tools besides xNormal.
Post Reply