polycount MessageBoard
  2D and 3D Discussion
  free but lousy way of doing a normal map... but its a nifty way to unwrap!

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   free but lousy way of doing a normal map... but its a nifty way to unwrap!
KingofDaveness

Posts: 218
Registered: Dec 2000

posted 07-24-2002 06:55 PM     Click Here to See the Profile for KingofDaveness   Click Here to Email KingofDaveness     Edit/Delete Message   Reply w/Quote
If you guys are skint theres a little trick to creating your bump map thats
not pleasant, but it IS free.

1: build your low poly model.
2: Select faces you want to unwrap and detach them all to elements.
3: Clone a copy of your mesh and edit it so that all your elements are
layed out in a rectange (like uvwunwrap)
4: Select all your unwrapped elements and scale the vertex along the Z
plane so that they are all flat.
5: Apply a uvw planar map and then put a uvwunwrap modifier ontop to pin
the coordinates.
6: Morph the model back into the original shape using the first copy. Dont
collapse it yet.

Ok now the clever bit.

7: Apply a tesselate to the morph, then paint a displacement map to put in
your little bumps, muscles and details. For example, you may choose to add
the philtrum, cheekbones, dimples, eyes, nostrils, lower lip, chin crease
and forehead curve using displace.
8: Slide the morph back to the flattened shape. Ok, see how the model is
still flat, but all those bumps you added are still sticking out?
9: Apply a gradient map to uv channel 2, then align it so the higher bumps
are white, the lowest is black.
10: Render this flat on.
11: Convert your bmp height map to a normal map using the free dos tool
from nvidea.

Like I said, its not ideal, but it gets you through if you want to spend 0$.


IP: Logged

tpe
Model

Freak

Posts: 2620
Registered: Jul 2000

posted 07-25-2002 12:26 AM     Click Here to See the Profile for tpe   Click Here to Email tpe     Edit/Delete Message   Reply w/Quote
Wow thats great, reminds me of the morph UV mapping technique.

If you are into lightwave then check this out, a free script that makes the standard lightwave do what polybump does (make normal bump maps)

not only that it was done on request by Arnie Cachelin a member of lightwave support for one of their stinky snotty end users (me).

For some reason i cant link the original URL so here is the script

To use it, apply the shader to the relevant surfaces, set diffuse to 0 and luminous to 100%, and add baker.
The normals are encoded into the RGB so that values from -1 to 1 map from 0 to 1 in the color.
x,y,z map to r,g,b.


//---------------------------------------------------------------------------
//
// LS/PT: BumpRGB.ls by Arnie Cachelin
//
// Convert surface normals to RGB levels, useful for baking bump maps
// for dot3 real-time bump map pixel shading.
//---------------------------------------------------------------------------

@version 2.3
@script shader

color;

create
{
}

init
{
}

flags
{
return(COLOR);
}

process: sa
{
sa.color[1] = 0.5*(1.0 + sa.wNorm[1]); // Shift negative normals into color 0 to 0.5
sa.color[2] = 0.5*(1.0 + sa.wNorm[2]);
sa.color[3] = 0.5*(1.0 + sa.wNorm[3]);
}


tpe

IP: Logged

KingofDaveness

Posts: 218
Registered: Dec 2000

posted 07-25-2002 01:17 AM     Click Here to See the Profile for KingofDaveness   Click Here to Email KingofDaveness     Edit/Delete Message   Reply w/Quote
Ohhh, I just got another one!

You can render the max file using colored lights to get the normal map and it looks better than heightmap conversions. Oooooh, those pretty colors.

You set max values thus...

Ambient 128,128,128
Material white... blynn, no spec or gloss, black ambient.
Blue 0,0,255 directional from the camera.
Green 0,255,0 from the top.
same from bottom with a -1 multiplier.
Red 255,0,0 from the right.
same from left with a -1 multiplier.

Render that baby and voila.... it works with the cheap version above too...

Damn. its full of stars.....

IP: Logged

Astro Zombie
Sick Boy

Posts: 1791
Registered: Oct 2000

posted 07-25-2002 07:48 AM     Click Here to See the Profile for Astro Zombie   Click Here to Email Astro Zombie     Edit/Delete Message   Reply w/Quote
Can I request that you do a tut complete with pictures showing the process and the end result? This sounds cool but I'd like to see it in action before I try it.

IP: Logged

Whargoul
Electronic Arts
Lead Character Artist

Posts: 567
Registered: Aug 2000

posted 07-25-2002 07:59 AM     Click Here to See the Profile for Whargoul   Click Here to Email Whargoul     Edit/Delete Message   Reply w/Quote
The problem with both of those techniques is that the normals are encoded in world-space, not local space to each face (usually called "basis-space" I think, since it's based on the S-T vectors for each face that I believe NVidia came up with for transforming lights into texture space).

So if you took your model and deformed it with bones, the normals won't transform with it and it will look messed up. I've been looking into this and that's why I know quite a bit about it My MEL version of this is coming along well, but it will be dog slow, so I'm getting a tools guy at work to convert it to a plugin and hopefully it'll be much faster.

IP: Logged

The_SP
PolY SlAv3

Posts: 132
Registered: Jan 2002

posted 07-25-2002 09:31 AM     Click Here to See the Profile for The_SP   Click Here to Email The_SP     Edit/Delete Message   Reply w/Quote
Yummy yummy Mel in my tummy If you need any testers for that handy script(plug-in) let me know
Cheers,

ThE SP

IP: Logged

tpe
Model

Freak

Posts: 2620
Registered: Jul 2000

posted 07-25-2002 10:34 AM     Click Here to See the Profile for tpe   Click Here to Email tpe     Edit/Delete Message   Reply w/Quote
Whargoul the Lightwave one is relative to the normal of the poly. Because of the way baker works it is a reasonaly trivial task, and a shame to pay so much for so little. Do you mean your task will work out the normal of the high poly on the low poly? If not you will still have problems when changing mesh res (progressivly worse with LODs)?

tpe

IP: Logged

KingofDaveness

Posts: 218
Registered: Dec 2000

posted 07-25-2002 04:39 PM     Click Here to See the Profile for KingofDaveness   Click Here to Email KingofDaveness     Edit/Delete Message   Reply w/Quote
Er, yeah Warghoul....

Whatever you say dude...

Erm.

Ok, look at it this way, its a morph map which is displaced and rendered. Nothing to do with bones. Therefore world space or not, it works fine.

IP: Logged

Nahaz
Junior Member

Posts: 9
Registered: May 2001

posted 07-29-2002 02:24 AM     Click Here to See the Profile for Nahaz   Click Here to Email Nahaz     Edit/Delete Message   Reply w/Quote
Whargoul, the first technique encodes the normals in UVW space. I have tried it on a deforming mesh in a pixel shader enabled app.

The second technique seems to do as you say, but obviously CryTek must have worked away around that?

IP: Logged

tpe
Model

Freak

Posts: 2620
Registered: Jul 2000

posted 07-29-2002 04:37 AM     Click Here to See the Profile for tpe   Click Here to Email tpe     Edit/Delete Message   Reply w/Quote
One un-avoidable problem with the crytek implmentation is that it projects pixel data from the high res model onto the nearest position on the low res uv, therefore there is a slight distortion proportional to the tangent of the plane of the high res with respect to that of the low res that will give some small errors. these errors will be present in all resolutions but will be greater on any lods that are no proximity calculations are applied. I think the easiest way round it is to go in a d edit the uvs for each model, althoug how prominant it will be with the LODs i dont know, hopefully they will be too far away to see the errors. Whatever, the Lightwave version (like the other two) does not take the res of the low poly model into account at all, all corrections have to be done manually.

Incedently i tryed putting the LW version and the crytek version side to side, and the major and only differences i could see with my eye were the presence of the watermark and the lack of resolution in the crytek, but i guess that is because i dont want to pay for the crytek version

tpe

tpe

[This message has been edited by tpe (edited 07-29-2002).]

IP: Logged

Whargoul
Electronic Arts
Lead Character Artist

Posts: 567
Registered: Aug 2000

posted 07-29-2002 08:27 AM     Click Here to See the Profile for Whargoul   Click Here to Email Whargoul     Edit/Delete Message   Reply w/Quote
For both of those techniques, you need to have matching UV's across both objects right?

IP: Logged

Nahaz
Junior Member

Posts: 9
Registered: May 2001

posted 07-29-2002 03:47 PM     Click Here to See the Profile for Nahaz   Click Here to Email Nahaz     Edit/Delete Message   Reply w/Quote
Don't have to match UVs with CryTek's plugin.

IP: Logged

KingofDaveness

Posts: 218
Registered: Dec 2000

posted 07-29-2002 04:48 PM     Click Here to See the Profile for KingofDaveness   Click Here to Email KingofDaveness     Edit/Delete Message   Reply w/Quote
Dammit, wheres Id when you need them

IP: Logged

Nahaz
Junior Member

Posts: 9
Registered: May 2001

posted 07-29-2002 05:29 PM     Click Here to See the Profile for Nahaz   Click Here to Email Nahaz     Edit/Delete Message   Reply w/Quote
Just dawned on me that id Software must be using LightWave to capture their normals. I remember seeing them using LightWave in that recent doom3 video.

IP: Logged

tpe
Model

Freak

Posts: 2620
Registered: Jul 2000

posted 07-29-2002 11:51 PM     Click Here to See the Profile for tpe   Click Here to Email tpe     Edit/Delete Message   Reply w/Quote
I have been using the controll mesh to map the uvs on my high res version, this way both sets of UVs are identicle for both resolution meshes so matching UVs is not needed. However the low poly mesh does need tweeking after to fit the high poly well, this would be necessary anyway whatever package is used.

When using lightwave (I think the modeling app used at id, not that it makes much difference as file formats are easier to convert for models than scenes) it is very easy to make the controll mesh UV map it and then apply a subpatch modifyer so the UV matching is not really an issue. If one were not using UV colour/bump/specularity maps on the high poly version and only procedural textures it would be an advantage not to have identicle uvs as atomatic mapping could be used on the high poly version, otherwise it does not take any longer or require any work to make both meshes have the same UVs.


Sorry not much scence in this post, too much help from 2 year old daughter

tpe

IP: Logged

All times are PT (US)

next newest topic | next oldest topic

Administrative Options: Stick Topic | Close Topic | Archive/Move | Edit Subject | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | polycount

i t ' s a c o n s t a n t c o s t u m e p a r t y


Ultimate Bulletin Board 5.45c