Normal Mapping for Games


#1

I’ll start posting any relavant links to threads or articles on normal mapping (more on general info and not software based, you can find those in the respective application forums) Hope this will aid those who are totally new to normal mapping like myself :slight_smile:

Omita’s thread-some info/images on tangent vs world space normal maps

I’d thought I’d start a new thread on this instead of hijacking dur23’s thread :slight_smile: Well, since normal mapping will be the coming of things for the next generation of games, it’d would be good if everyone could share their thoughts, questions, theories, workflows, etc on this topic.

To start things rolling, i’ve got a few questions(well quite a few actually). What is the normal workflow like for the generation of game model that will require normal mapping? Do I start with a hipoly model and cut down to a lopoly one, or vice versa?

UV mapping would probably come in once the hipoly model is done? and won’t cutting down the model to a low res one affect the uvs? How can we make sure the uv’s turn out right on the low res model since we are doing so much poly editing on the model?

Hope someone has the answer(im sure there is). Either way, if anyone has any questions/topics to raise on this subject, feel free to do so


#2

Welll…first of all, normal mapping does’nt mean that you have to create a highpoly model. You could create a bumpmap and convert it to a normal map.

There are three different coordinate systems that can be used for normal maps: World space, object space and tangent space. Tangent space is what you would like to use for anything that deforms. Object space works fine for non-deformable objects, such as vehicles. World space works only for static objects…
Wich of theese you should use, i dont know…that is up to the programmers of the game to decide. I’d guess that tangent space is the usual choice though…

I dunno about the workflow…i’ve only done one normal mapped model (a vehicle), and when i did it i decided to create the lowpoly model first and the detail and bevel it to create the highpoly model. If i where to do a character, i’d probably start with a highpoly model.

Modelling the highpoly model might be prett difficult too…you do not want overlapping geometry, since it may cause problems with the normal map generator. When modelling characters, i don’t believe this is a big problem since organic models can easily be done without overlapping geometry, but if you’re creating a vehicle, you may have to boolean/model all the details onto the main model. You’d also have to think about only creating details that are possible to be normal mapped…

You’ll only have to uv-map the lopoly model. When you do, then avoid overlapping uv’s since they will probably cause you a lot of trouble.


#3

I’m in the middle of trying my first normal mapped character, and I’ve figured out a few things, but not all, yet…

From what I can tell, it makes no difference whether you model hi first or low. What matters is you end up with both.

Myself, I like to blck out my characters first, and then slowly add in the detail, so it works well for me to model the low-res first. I think this is one of the better ways to work, as it will be the final model, when it comes down to it, and you should really get this right.

But I could see in a production style environment, how it would be likely to see seperate artists working on the low and hi res models, in which case it seems easier to create the high, and then retro-fit the low.

On thing I think is really cool about normal maps, is it really opens up the possibilities for skinning and modding. Because essentially you’re making a texture out of the whole process, you could theoretically have one low res mesh, with many different hi-res meshes adding geometrical data. So with simple texture swaps, you could have vastly different-looking characters in your game.

I will continue this with a question, though. Does anyone know anything about the best way to paint the diffuse map when dealing with normal maps? How much does the pushing around of the normals affect the placement of diffuse pixels? For example, I’m going to have some circular indentations in the armour of my character, and I need them to be black in the holes, and also have scratches along the edge. Whith what do I line these up?

Also, can anybody tell me which colour is Y, which is X and which is Z, or if it’s closer to N, U and V?


#4

Staffan - the 3 coordinate spaces u mentioned, are they options that u decide on when u export your normal map out of the 3d software? when u started addin details to your vehicle, u had your uvs already mapped out i assume, and when u were increasnig the lod, did u make sure not to touch the verts of the lowpoly model? cos when u do, the uvs get messed(imagine chamfering a vert once uvs are mapped)

what i’m concerned about is how to handle your verts when cutting down from a hi poly model, ensuring that u dont end up screwing your uvw maps which were done on the high poly model.

Dargon- cool. do u have a wip thread goin on in here? if u do, pls post a link, i’d love to see your progress.

hmm, it doesnt matter which i do first? be it hi or lo poly? but it matters when uvw mapping comes into consideration… no?

as for addin of detail, unless u have zbrush, you would have to add the details in your 3d s/w…and then again my concern once more on uvw mapping, cos all those addin of detail would probably screw up your maps, u wouldnt have that much freedom with your poly editing.

wish i could help you out with your questions, but im pretty to this normal mapping thing. hope someone answers them.


#5

Hi maybe this thread may of help to you.

http://www.cgtalk.com/showthread.php?s=&threadid=87991&highlight=normal+mapping


#6

Hi maybe this thread may of help to you.

http://www.cgtalk.com/showthread.ph…=normal+mapping

Good thread, I’ve used that one a lot, unfortunately, 3DSMax heavy - good to keep this one going for general practice and general tools, methinks! :wink:

hmm, it doesnt matter which i do first? be it hi or lo poly? but it matters when uvw mapping comes into consideration… no?

You only have to UVW map your low-res model. You can UVW the high-res, and add bump maps, to ahve them be applied to the normal map, but if you don’t want those, you don’t have to do them. Either way, the UVW maps don’t have to match. (it would be nigh-impossible to do in many cases, anyway…)


#7

MC- tks for the thread dude. been there before too, like dargon said, opening up a thread here would probably receive a wider audience.that way we can probably consolidate more info here. :slight_smile:

dargon- tks m8! you probably solved one of the biggest question marks for me when it comes to normal mapping. LOL! phew, im glad i got that out of the way. the bump maps come in seperately or added on to the normal map? or is that an engine-specific question?

Hopefully i get my hands dirty with some normal mapping soon. can’t wait to test things out.

After seeing dur23’s model, i realised that his diff map did not have much shading, rather it was flat so that the normal map could do the work. Would there be a difference if i had subtle lighting in the diff map? just like in FPS models like ut2k4.


#8

You don’t have to uvmap the highpoly model even if you want to add bump mapping. Since a normal map and a bump map is basicly the same thing, if you have the right tool you can bake the bump map into the normal map after it has been generated.

About lighting: the lighting that will be provided in the game will be aimple and probably without self-shadowing. It would sometimes be a good idea too bake/paint a flat skydome style lighting on the model, making indented areas darker and dirtying up details…(if you look at dur23’s model, you can see that it would probably look better with subtle shadows where the skin meets the armour, etc.)


#9

the problem with convering bump to normal is u cant paint the bump accurate enough for curved surfaces, imagine u have a lo-res sphere and u want to normal map it so its smooth (dumb scenario i know but just read it) if u wnat to conver bump.normal ud then have to by hand/eye paint the lo-lights and highlites perfectly to get a flowing shape near impossible, however if u could subdivide the mesh*2 and generate a normal map of that smooth mesh u could then paint on details like veins, ribbing, muscles etc since u have the correct base, but theres no way u could effectivly hand paint a smooth base to turn a hex-cylinder into a smooth round shape, it would be so time consuming to do because ud have to sit there and do it a tiny bit at a time. but yah if uve a correct smooth base theres no reason u cant u paint ontop of that its just the intial smoothing, id be very worried if it required hi poly models of everything tho! nightmare


#10

staffan- tks for the tip. baking the normals for the hipoly model would be rather messy wouldnt it? i mean, what if we wanted to do some changes directly on to the normal maps?

commy- would you be able to bake some lighting on the bump/normal map in the 3d s/w? wouldnt that ease the workflow?

Hmm, not much of a response just as i thought. :slight_smile: maybe this thread IS in the wrong place afterall.


#11

The main reason I see to put the bump on the hires version, to bake to the normal map is precision. It could also be for ease.

Because the UV sets don’t have to match, you could Auto Map all the areas you don’t need precise bump on, and squash that down to an unused corner of your texture sheet. Then, you just UV the areas that need bump.

I’m thinking along the lines of engraving, maybe seam lines, anything that you wouldn’t want to model, but you’d want in the final map. In a lot of cases, you wouldn’t need to bump map the whole object, or all the fiddly details. Anything less specific, like scales, or rough metal, woodgrain, could be put on in a seperate pass, because it’s less dependant on precision.


#12

Still seams like a great waste of time to uv-map the highres model…and on a neatly uv-mapped lopoly model, you’ll have precision enough. :slight_smile:


#13

I do think this is the best section for a software-agnostic normal-mapping thread.

How much does the pushing around of the normals affect the placement of diffuse pixels?
It doesn’t, I find the pixels should be lined up for the best results… unless I’m using Parallax bump mapping (normal map combined with a heightmap, pixels offset using parallax). But even there, the match is still pretty close, I just get some smearing sometimes. Oh well, it’s a trade-off. Play with the EXE, it really can be stunning.

which colour is Y, which is X and which is Z, or if it’s closer to N, U and V?
Tangent space uses the red channel to slope the normal to the right, green channel depends on the hardware (ATI expects pixels in the green channel to slope the normal upwards, while NVIDIA expects them to slope downwards), and blue channel points outwards (not much info with a tangent-space map). Object/World space is, well, in world space… so red is Down, green is At, and blue is Left (well, at least on my ATI card… anyone know if this is different with the Nvidia chipset?).

About UV-ing the high-res model, one benefit to doing so is being able to texture to your heart’s content, using layered shaders, displacement mapping, multiple UVs, etc. Then just bake it down to the low-res model, into your various real-time shader passes… color maps, specular maps, normal maps, reflection masks, etc. I like it since it gives me more control over what I’m going to get, but for some projects it may be more time-consuming than just deriving the normal map, and hand-painting the rest.

I like that there are many ways to approach it, none is the “right” way, unless it works well for you or your project.

Oh, and don’t dismiss painting normal maps… Nvidia’s plugin for Photoshop does a great job converting grayscale bumps into normals. It is a really easy way to add fine detail, like Dargon described.

Cool thread dom, thanks for starting it.


#14

Hey guys. Great thread! I’ve written a tutorial on my web site that explains what normal maps are, gives step by step instructions on how to create them using Photoshop and/or 3DS Max, and also describes how to use per-pixel lighting to view them applied to your model. A lot of the information in the tutorial has already been covered in this thread, but you may find something new. Here’s the URL:

http://www.bencloward.com/tutorials_normal_maps1.shtml

At the end of the tutorial I’ve included a list of links to all kinds normal mapping information that I’ve found all over theweb.

Give it a read and tell me what you think.


#15

Wow, Ben this is great. What a good resource!

Like others said about my thread, yours seems to be somewhat 3ds max-centric. Although you have a lot of software-agnostic info too. Maybe include some info about setting up normal map shaders in Maya, Lightwave, XSI, etc.? I don’t know how far you want to go with it though, but your tutorial/repository is really great so far.

Thanks again!


#16

Yeah, your right. Max is the only software package I have so it’s the only one I can give detailed step-by-step instructions for. Pages 1 though 4 of my tutorial are useful to everyone as is page 8. Only page 5 and page 6 focus on step by step instructions in Max - although you can do all of the same things in Maya. I just don’t have the software so I can’t get as specific. That’s the main reason I posted all of those links at the end. You can find info there on creating normal maps in every major package available.

Thanks for the feedback. Maybe I can find someone with Maya to help me update pages 5 and 6 to include Maya details.


#17

Ok, thanks for the advice. I added some bits to page 5 so that you can now follow the tutorial steps using any software that supports OBJ format (thanks go to Michael Bunnell!!)

Page 6 (covering viewing your model with the normal map applied) is still very Max-centric, but I added a note which directs people using other software to my link list at the end. You can find links there for using normal maps in Maya, Softimage, Polybump, and others.

I haven’t made page 7 yet, but I’m planning to give tips for modeling high and low res versions, and applying UVs to get the best normal map results. I’m planning to include some tips on generating normal maps including descriptions of some of the additional features of NormalMapper. I also want to give some guidelines for editing normal maps in a paint program.

Anybody want to suggest some tips and tricks I should include?


#18

Dargon, Steffan- yeah i agree unwrappin the hipoly model would take helluva long time. It really depends on how much time u can afford.

The question is whether it will be worth it to add another pass for finer details like Dargon mentioned. Wouldnt it be more economical if we had the finer bump details converted into normals and composite it over the normal maps? What about renormalizing in pshop? any idea?

Eric- yeah its nice that there are several workflows available. my question once more is renormalizing in pshop so that we can retain an accurate normal map.

Ben- GREAT tut, yours is by far the most concise i’ve seen. a billion thanks. would be nice if we could get any info on painting on a normal map :stuck_out_tongue: I’ll look ard the web but chances are there wouldnt be much info on that.

I’ve got a tip: wait for the next update for melody, the current one is crash friendly. LOL.

Im currently havin a friendly discussion with a programmer. he claims that it is appropriate to generate a normal map from a greyscale image. I do know that since for characters, your uvs are layed out everywhere that it is best for a 3rd party program like kaldera or normalmapper to get the normal maps from a 3d model. That way, the normals read correctly no matter how u rotate ur uvs. Am i right on this one?

Tks for all the sharing guys. Sticky for this thread anyone?


#19

My workflow goes like this:

  1. Model Object in 3D Studio Max (Low Poly)[list=a][li]Upon completion of the mesh, subdivide the thing. I prefer doing this in Max, althought it’s possible to do this in step 2.[*]Export mesh to OBJ. Although you can go insanely high, for something like a human head I keep it around 150,000 polys.[/list=a]
    [/li]

  2. Import low poly object into ZBrush.[list=a][li]Working on only one side of the head, sculpt major details into the mesh first[]Sculpt minor details last (hairline wrinkles, crow’s feet)[]Export to new OBJ file.[/list=a]
    [/li]3. Import back into 3D Studio Max.[list=a][li]Cut the thing in half. Slicing the face down the middle will ensure that you only have the half you worked on.[]Work all the verts to the same relative point on the given axis, so when mirrored, it will join easier.[/list=a]
    [/li]4. Mirror horizontally, align it with the other half of the head, and export the new half of head to yet another OBJ[list=a][li]Bring that into ZBrush again.[
    ]Add different details. Not too much, but this is a good time to give him a deep scar that is unique to that side of his face, or a screwed up eye, or whatever you want.[*]Export back to OBJ, import into max[/list=a]
    [/li]5. Join the two, and weld whatever you need to weld.[list=a][li]Duplicate the newly joined mesh, and move it over so you can see both copies at once.[/list=a]
    [/li]Here is where it gets fun.

  3. Using your favorite method of poly reduction, bring the new mesh down to a suitable size for your game world. Sometimes you can get it down to within a small percentage more (or even less, if you’re sloppy) of the original low poly mesh. This produces a result that is more like the detailed mesh than the original low poly version, so applying the normal map to this will look better and more convincing than applying it to the original low poly mesh.

  4. Using your favorite method of creating a normal map from your first high poly head, apply it to the intended mesh. Fix any problems that there might be with seams, etc.


#20

Ok so your saying to build the low in max and subdivide it then bring it into zbrush, then do details, then bring it back into max again, cut it in half and mirror it then being it back to zbrush, do minor details, then bring it back into max but start cutting the pollies down for the subdivided mesh to make it low polly all over again, but use a copy of the high polly for the normal map, but use it on the now more “detailed” low polly mesh?

Sorry I just want to see that I’ve got this all right