Jump to content
The Dark Mod Forums

Modeled And Painted Normalmaps?


SneaksieDave

Recommended Posts

Got a bit of a conundrum here, and I'm wondering if there is a simple solution I don't know of.

 

What do you do if you want a model's normalmap to contain both modeled geometry (e.g., roundness, panels, buttons, etc.) from a highpoly version, but also painted geometry (scratches, grooves, noise)?

 

It occurred to me if I make a normalmap from a highpoly version of my model, it might be fine for large details and modeled shapes, but it will be absolutely devoid of any realistic scratches and noise (and those will not be modeled). How to get around this, is there a way to combine two normalmaps, either with blending in the material, or within photoshop?

Link to comment
Share on other sites

How to get around this, is there a way to combine two normalmaps, either with blending in the material, or within photoshop?

 

You can blend two normal maps together, I have done this many times in the GIMP. The normal blend mode doesn't work, you have to use something called "Hard light" or "Soft light" (I have no idea whether there are equivalents in Photoshop), and then re-run the normalmap plugin in "Normalise" mode.

 

You can also use the addNormals() function in the MTR definition to combine two normalmaps in-game.

Link to comment
Share on other sites

I assume that it blends the two normal maps into one main map, which is then sent to the graphics card. As far as I know there is no shader support for blending normalmaps on the GPU, so this would have to be done by the engine in an image preprocessing stage.

Link to comment
Share on other sites

In Photoshop there's Overlay blending mode which does the job for any amount of normal maps you wish to.

 

AFAIK doom engine accepts also height maps which are converted to normal maps and mixed together with existing normal map while loading, but it's better to do it in Photoshop cause in that way we save some disk space The Mod is going to use on HD and probably some loading map time...

Link to comment
Share on other sites

Okay, so doing it by hand might have performance benefit, and you can hopefully eliminate unpredictable results.

 

Well here's what I got, it looks like it works (mostly). I started with two white images and made fuzzy black squiggles. I then used the normalmap plugin to create a normalmap. So far, no problems. Then, I used the normalmap plugin to convert to height - I couldn't find any way to combine them both as normalmaps (clue me in if I just don't know the trick). At this point, if you look really close, you'd see there is a slight quality problem; some banding occurs from top left to bottom right. No idea why. Then combine with 'screen' (soft and hard light didn't work well), and re-normalmap. At this point, the noise from the banding is quite worse, but I'm hoping something can be done about that.

 

Should I not be converting to height first? I don't see another way to blend what is essentially multiple colors with a specific meaning.

post-58-1156519034_thumb.jpg

Link to comment
Share on other sites

Dave, your overlay image is correct. Just run it through the normalmap plugin in Normalise mode to ensure that the values are within the required range (you may not even need to do this, but I always did just to be safe).

Link to comment
Share on other sites

Sneaksie - well, yes - it looks weird for such things but it would look better if you wanted f.e. to add some scratches or small organic bumps onto your normal map (just like you've mentioned in your question).

Link to comment
Share on other sites

Right, levels helped quite a bit to get rid of the noise/gradient shit, which must be a defect in nvidia's plugin. Black + Black = strangely fading Grey? No, nvidia, it's not...

 

When I did the normalize to the overlay image, it came out terrible. I'll fiddle with some settings.

 

Here's the result of normalize on the overlay. Looks pretty much the same.

post-58-1156521874_thumb.jpg

Link to comment
Share on other sites

And here's after a bit of levels adjustment and a gaussian blur to add back in some removed sharpness (edit: duh, I mean smoothness). Decent results, I think? (compressed as JPG here of course)

 

Compare to the first attempt: http://forums.thedarkmod.com/index.php?s=&am...ost&p=82172

 

Edit: as always, thanks for the guidance guys, you're a wealth of information. :)

post-58-1156522321_thumb.jpg

Link to comment
Share on other sites

And here's is nvidia's idea of black + black. Look closely and note the gradient from top left to bottom right, fading black to ... less black. When re-normalmapped, it shows up pretty strongly.

 

Huh? I can't see any gradient in that image, looks like solid black to me.

Link to comment
Share on other sites

Grab that image and adjust the levels... you'll see it. Here it is below after shifting the midrange toward dark. It really shows up when doing a normalmap or normalization filter. The whole thing slopes upward (since it's getting lighter). Since it was only adding two basically black heightmaps together, it's probably a filter bug.

post-58-1156523144_thumb.jpg

Link to comment
Share on other sites

Gah. Even crappier is that the normalmap plugin is unable to convert some things to decent heightmaps at all (I have no idea why - it just wants to turn it into a gradient field with a few dents, which is very much not what the normalmap looks like), and worse, even if it did work, even at 4 sample and a decent height, it washes all the detail out. That's even with trying it with some of the character normalmaps - all detail lost. So it looks like the approach of normalmaps -> heightmaps -> blend -> normalmaps is out, afterall. Sure it works for a blurry squiggly. Just not for anything useful.

 

So I'll be trying suggestions above/what Oddity posted in the docs forum. That should keep crisp detail, assuming the heights don't compete (which I guess they must not, if this works, but I don't understand how).

 

Next I have to figure out the best way to skin something; getting around weird shapes (I assume this involves transforming base textures to contour to needed shapes) and avoiding obvious seams. No idea what to do there.

 

Sooner or later I might have a nice product. :rolleyes:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...