Because its Halloween or something...

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
BradMick
Bounty Hunter
Bounty Hunter
Posts: 223
Joined: Sun Oct 26, 2003 7:48 pm
Contact:

Post by BradMick »

alrighty...fully unwrapped, both lwo and 3ds format versions. enjoy it.

i'll try to texture it, dunno if i'll be able to.
You do not have the required permissions to view the files attached to this post.
LightWave nerd extrodanaire...

"Who need drugs when you got Brad? He's a trip enough already!' - stoner friend of mine...
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

WOW! Exquisite! You'd better get on with the texturing; otherwise I might put the hellcat aside and jump to it ... ;-) Can't wait to see this IG.
spiritplumber
Developer
Developer
Posts: 1831
Joined: Mon Mar 07, 2005 10:33 pm
Contact:

Post by spiritplumber »

That looks _really_ nice. Can I hug it?

I hope John will put it in GG too, eh!
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.
John Cordell
Mercenary
Mercenary
Posts: 125
Joined: Sat Jul 10, 2004 9:43 am

Post by John Cordell »

spiritplumber wrote:I hope John will put it in GG too, eh!
Sure but it needs a texture first ;)
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Well, last Friday I decided to take another look at Brad's Demon. The proportions and all that were perfect, but as Privateer Ferrius had claimed, the UV unwrap was not very usable:

1) Not using space very efficiently; big empty areas
2) No consistent alignment; some parts had the front to back alignment vertical; some horizontal; which prevents using global motion blurs for things like smoke marks and scratches.
3) Some symmetric pieces overlapped other pieces; some didn't, which wreacks havoc with radiosity baking.

Obviously Brad was in a hurry.

So I figured I'd re-unwrap it...

But then I found that there was no way to unwrap it efficiently because there were huge amounts of hidden geometry inside the model, from all the floating, interpenetrating meshes. This is bad also in that it causes a lot of overdraw.
So I went into the model, pulled out a sharp knife and started trimming all the excess.

But then, when I was done, --and I got it down to a close shave--,I was one step away from having the pieces welded.
I welded the little wings to the engines, just to try, and it looked so much better I couldn't stop myself welding much of the rest of it.

Finally, a lot of the geometry was using flat shading, which multiplies the number of vertices processed in the gpu; so I highlighted everything, smooth shaded it all, and then proceeded to split the smooth groups.

Here's the result:

Image

Image

Image

I got the new unwrap almost finished:

Image

Thought I'd show it before hitting the bed; I'll probably finish the unwrap tomorrow --er, today... and do the bakings Wednesday.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

That's great, chuck.
Are you planning to have a non-unique unwrapping as well? Though your unique unwrapping seems pretty efficient, I fear that it will take a mighty fine resolution to get acceptable detail. Though detail textures might do the trick.
BTW: I've found that you can do the normal AO bakings (not the weird one I devised) with non-unique unwrappings if the overlaps are on axis simmetries. That's because AO is quite symmetric too. The procedure goes like this: separate the mesh so that you have a few separate meshes instead, each with unique unwrappings (but don't re-unwrap - the idea is, for instance, if the top uses the same coordinates as the bottom, make an object with the top, another with the bottom, and bake separately). Then, take all those separately-baked images, and combine then in gimp into multiple layers - I'm not sure how this gets done in gimp, but you have to make the layers blend such that the end result is the maximum RGB of all layers. That will seamlessly blend the multiple bakings quite nicely.
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 »

Ah, good to know.
Yes, I was going to try and KISS it, but certainly the resolution sucks, without overlaps. I'm thinking that dual UV's will have to become the standard for all models; big or small. It's too bad the normal map can't be mirrored; as it's what really needs the highest resolution.

Here's a bottom view I was going to add to the previous post:

Image

Gotta run to work now; later.

Are you sure we can't mirror the normal map? What if we standardize X to be the symmetry axis, and standardize that model space X always aligns with UV-space Y? Then all the shader has to do is multiply the Y component of the normal it reads by the sign of X. Just a thought...
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

chuck_starchaser wrote:Are you sure we can't mirror the normal map? What if we standardize X to be the symmetry axis, and standardize that model space X always aligns with UV-space Y? Then all the shader has to do is multiply the Y component of the normal it reads by the sign of X. Just a thought...
I understand it can be done, even without that trick, but as experience has shown, it takes an unwholy amount of work for the untrained. First, tangentspace normalmaps (to be mirrorable) need this care in triangle winding that is really hard to control when modelling (at least, from my little experience with Blender, I have no clue how to do that). Like you can't mirror and forget, you have to make sure mirrored parts get triangulated in a certain way and with a certain winding as to avoid those artifacts we're used to. Then, it's the nitpickiness of baking tools. Then... who knows what else. I mean... we've tried, and it has taken unholy hours. Sure it would be great, but perhaps we should accept we're not pros and let go for a while... to get some progress, I mean.
Besides, that may push detailing techniques far beyond what's normally done, since it will be that crucial to us. Then... if we do get mirroring normalmaps eventually... it can only be better... right?
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 was thinking of it like this:

For 90% of the ships, overlap means folding around X. We could make it explicit that if you mirror around x=0, normal map folding works right out of the box. For the other 10% of cases, say the SES, where there may be 100 square tiles sharing a common normal map, you can say "if you want to do that, then you have to observe the following rules: 1, 2, 3...".

In the case of AO baking with a simple x=0 folding is easier than you described. Simply highlight half the ship and separate it (into another object). Now bake the non-separated half of the ship, with the separated half just sitting there. The resulting bake should be good for both sides when rejoined.

So here again, the tutorial could say: "if you use more overlap than mere X-mirroring, then ... (do multiple bakings, blend in Gimp with 'lighten only', etceteras)".

Ehm... before someone asks, tri-count stands at about 5500, vs I think it was around 3000 in Brad's original mesh. IMO this mesh should process faster in the GPU because of the heavy use of flat shading and extent of overdraw in the original. Here everything uses smooth shading and there isn't a single invisible polygon.
Here's the current file:
http://deeplayer.com/dan_w/WCUships/Demon/demon7.blend
EDIT:
Sorry, that save file is in layer 2; just switch to object mode, then to layer 1 to see the real ship. Layer 2 has a subsurface set for future normalmapping work.

PS: Triangle winding in Blender is controlled by the face normal, automatically. If face normals point outwards, winding is right. In terms of triangle winding in the texture, it's a matter of unwrapping as viewed from the outside; --i.e.: only mirror islands across the X mirroring plane. That should be easy to grasp.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

You know one easy rule you might try?
Negative X tex coord inverts Tangent.
Negative Y tex coord inverts Binormal.
That should give enough power to control tangentspace (and thus get correct results)... right?
I'll have to try that when I get the time...
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 idea what the binormal is, but I'll take your word for it :D

Blender is cool, but the python scripts suck. I had a small corruption; a floating edge, that none of the cleanup scripts would get rid of. So finally I used the mother of all fixeverythings with Blender: Exported obj, and imported into a clean blend file. Fixed that problem, and imported UV's, smooth groups, the whole shabang... EXCEPT seams. So I had to redo all the seams to match the UV layout. Needless to say, I didn't go to work. Yet I haven't finished the UV layout yet; almost stuck in a rut just before the end of the tunnel...
BradMick
Bounty Hunter
Bounty Hunter
Posts: 223
Joined: Sun Oct 26, 2003 7:48 pm
Contact:

Post by BradMick »

You can't mirror the map, but what you can do is mirror the mesh. Do all the UV work on half the model, then mirror it over and voila! now you get double the resolution for the same polys, the only problem is that now you can't do any kind of text or anything like that, and it makes doing camoflage a pain as well. But, if its double res for the same real estate you want, UV 1/2 and mirror.
LightWave nerd extrodanaire...

"Who need drugs when you got Brad? He's a trip enough already!' - stoner friend of mine...
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

BradMick wrote:You can't mirror the map, but what you can do is mirror the mesh.
Yes, I worked like that, for the mesh work, but at the end had to Apply the mirroring. More below:
Do all the UV work on half the model, then mirror it over and voila! now you get double the resolution for the same polys, the only problem is that now you can't do any kind of text or anything like that, and it makes doing camoflage a pain as well. But, if its double res for the same real estate you want, UV 1/2 and mirror.
Unfortunately, that doesn't work for the GI bakings (PRTP and PRTN textures). GI (global illumination) is basically a way to bake ambient light with directionality info. Instead of placing a radiant sphere of white light around the ship, as in ambient baking, PRTP uses red, green and blue light from the x, y and z axes; and PRTN does the same but from the negative sides of the axes. Klauss' shaders can then compute ambient illumination at a point on the surface, and tell the general direction it's coming from, from the balance between the color components in these two textures, and use that direction to pick a spot in the dynamic skybox. What this gives you is like an ambient + radiosity baking but more sophisticated: It has soft, moving shadows, and responds to changes in the global illumination picture dynamically. Self radiosity is also captured dynamically. Even specular spotlights use self-occlusion.
The catch is that you need a non-overlapping, unique UV mapping island for every part of the ship. Islands can't be shared.
Normal map baking also has issues with folding in the UV or other UV island sharings or overlap.
So, we are standardizing to using dual UV mappings: One with and one without overlap. With overlap: for standard texturing (diffuse, specular); without, for prtp, prtn, static light map, and normal map baking.

The unwrap I did is the one without overlap, since I want to produce the bakings first.

What I'm struggling with now is coming up with a smoother version of the mesh to use for bakings. But Blender is always changing and evolving, and the way to deal with smoothing groups now is to mark creases and then use an 'edge split' modifier before subsurfing; but some polys are getting automatically edge-split that shouldn't be...
http://blenderartists.org/forum/showthr ... 5b&t=89697
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Klauss, I was just thinking, would it help you to have static light map that includes a bit of starlight in it? I mean, you wouldn't then have to copy skybox info to the dynamic skybox; just dynamic lights and special lights, like a planet nearby or a bright nebula.

EDIT:
Thinking some more: The static light map, if we limit static lights to green, red or yellow, we could use the blue channel for standard radiosity baking. Might save you a few instructions if you are adding all prt components to get a sum total of illumination in order to compute the angle of the illumination cone. Just a thought...

By the way, I solved the problem I was having. For the record, and as per Blender version 2.43, you don't need to split smooth groups. Do this:

1) Highlight everything with A.
2) Rem Doubles
3) W -> Set Smooth

It will look like made of chewing gum...

4) Go to Object mode and add the Edge Split attribute.
5) Click the From Angle button to turn that stupid feature off
6) Go to Edit mode and, because of a bug, I say...
7) Highlight everything again and Shift E -1 (minus one) Enter, to remove sharp edges spuriously put in by the attribute.

Still looking like chewing gum...

Then, select all edges that should look sharp, plus all non-manifold edges, and do two things:

1) Ctrl-E -> Mark Sharp (marks edges as sharp for shading)
...and with the same edges still selected...
2) Shift-E 1 Enter (so that when you subsurf Katmul Clark it doesn't pull the edges in...)

But don't subsurf yet. Copy in Object mode (Shift D), right-click, and move (M) to another layer. Go to that layer and subsurf the copy (Katmul Clark, level 2). Reason being, things are going to need fixing. Probably you missed some of the sharp edges, you know what I mean? Besides, you'll need to make a triangulated version of the original for export, and to bake a normal map against; otherwise you won't know which way the quads will be split in the video card, so the normal map corrections could be wrong...
You can Apply the Subsurf without applying the Edge Split attribute. It will warn you but will let you do it.

So then you can use, say, xNormal. Feed it the triangulated mesh as the coarse mesh, and the subsurfed mesh as the fine mesh. You might want to grow the triangulated mesh first, along normals, with Alt-S, so to make sure the fine mesh is inside the coarse one. And of course you want to feed it your bump map, at this point too.

EDIT2:
I just found the formula for Gamma correction:
new_pixel_value = old_pixel_value^(1.0/gamma)
But when you're baking radiosity in Blender, the default value for Gamma is 2.0. Which means that the radiosity bakes I've produced in the past were the square root of what we want! :(
Gotta remember to put it at 1.0 ...
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Ambient occlusion shot:

Image

Just quick and dirty, for my own texturing purposes, not for any use by the game engine.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Apparently, the radiosity baking doesn't recognize sharp edges or creases; I had to split the smooth groups to get sharp shading...

Image

Now the problem is I can't seem to save the texture. Darn...
http://blenderartists.org/forum/showthr ... post817349
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Did you try Blender's new baking functions?
They're pretty nice. Much nicer than those old python scripts.
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 »

Yes; that's where my problem comes from: In order to bake to a texture, the texture has to exist already and be 'Applied', whatever that means, I'm trying to find out... Otherwise you get "ERROR: No Images found to bake to".
DualJoe
ISO Party Member
ISO Party Member
Posts: 387
Joined: Tue Mar 21, 2006 2:37 pm
Location: Netherlands
Contact:

Post by DualJoe »

Just create a new image in the uv-editor and set the resolution you want. Save the image and then you can bake your texture.
Don't forget to save the baked texture after that.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Thanks, Dual. I could swear I tried that many times, but I'll try it again tonight when I get home.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

I've tried that many times already; got similar suggestions at blenderartists and tried those too. I even re-installed 2.43. And I keep getting the same error message... :-/
http://blenderartists.org/forum/showthr ... post819293
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

SUCCESS!!!

Image

It's unbelievable how undocumented Blender is...
Dual, what you (and others) suggested never worked for me.
Image -> New consistently does nothing for me.
However, I was able to Image -> Load an image file, and that was good enough as far as getting an image set-up for baking to.
I was still getting the same message, though: "No Image to bake to".
What I discovered was that the object to bake had to be in layer 2, AND
it had to be selected.
At that point I started getting a totally black image.
That turned out to be the fact that I had put the material's Ambient component, in the Shader panel, down to zero. Cranking it up to 1 produced the result above.

I'll write this into the wiki.
Last edited by chuck_starchaser on Sat Feb 24, 2007 11:59 pm, edited 3 times in total.
snow_Cat
Confed Special Operative
Confed Special Operative
Posts: 349
Joined: Thu Jan 05, 2006 12:43 am
Location: /stray/
Contact:

Post by snow_Cat »

^ - -^ you know, I had a coat like that. Was forest green when I got it but sunlight (UV) faded it to blue, and by the end of the season it was pink with blue 'tiger' stripes.
If it weren't pink I'd have kept it.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

LOL
You sure sound like a chameleon-cat. And you'd better watch those UV's if you've turned snow-white. At least I'm sure you don't run away like some cats I've known, every time I hit Filters -> Enhance -> Destripe in Gimp.


Padded to minimize filtering artifacts:

Image
Post Reply