Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Modding Tutorials => Topic started by: --Steve-O-- on February 02, 2008, 02:00:20 pm

Title: normal maps....HOW?
Post by: --Steve-O-- on February 02, 2008, 02:00:20 pm
is there a plug in for GIMPshop that will do this? if not is there a free program that will use plug ins to do this? and if not.... how do you do them by hand, using GIMPshop with no plugins?

now for some other questions. what exactly do normal maps do? i know at least from what i've seen, they add details that looks like geometry greeble in some type of bump mapping. do they also eliminate the need for shine maps and environment maps by being like the multi use map?
i was just playing the Earth Defense demo and it looks awsome with the mapping and such, so it kinda kicked off my need to figure out what i need to do to get my things to look that good in game.
Title: Re: normal maps....HOW?
Post by: Herra Tohtori on February 02, 2008, 02:15:59 pm
GIMP Normal map plugin (http://registry.gimp.org/plugin?id=4485)

Works fine on normal GIMP. Dunno about GIMPShop, but AFAIK it *should* work...

That will make a normal map out of bump (elevation) map. It has a pretty good array of options, too (IMHO).

However, you will still need to convert the normal map to DXT5nm (DDS) format for it to work in FS2_Open. This you can do with the NVidia DDS tools.


As to what the normal maps do... AFAIK they pretty much add specular per-pixel lighting (for main light sources, ie. suns) to the graphics, and the information on the normal map... well, changes the normal of that particualr piece of the model's surface, which results in light being reflected to different direction than a flat vertex would. Which is interpreted as intrusions and dents on the surface by us humans.

Height maps add to the illusion by adding a parallax shift between "low" and "high" portions of the surface as the model turns on the view.
Title: Re: normal maps....HOW?
Post by: Water on February 02, 2008, 02:58:18 pm
You have a few options.
xNormal and Crazybump are two other programs that can create normal maps.

Either by creating a greyscale map or by going the hi poly -> lo poly method.

http://www.xnormal.net/ (http://www.xnormal.net/)
http://www.crazybump.com/ (http://www.crazybump.com/)
Title: Re: normal maps....HOW?
Post by: --Steve-O-- on February 03, 2008, 11:51:58 am

As to what the normal maps do... AFAIK they pretty much add specular per-pixel lighting (for main light sources, ie. suns) to the graphics, and the information on the normal map... well, changes the normal of that particualr piece of the model's surface, which results in light being reflected to different direction than a flat vertex would. Which is interpreted as intrusions and dents on the surface by us humans.

Height maps add to the illusion by adding a parallax shift between "low" and "high" portions of the surface as the model turns on the view.

ahh...trickery never looked so good until now. it still amazes me to see how far this game engine has evolved from the day i first played FS and FS2 when they first came out.

i'm playing with crazy bump now, and liking it very much. its easy to use, though it has a bit of a superiority complex. puny humans... :doubt: im sure i can download a therapist plug-in to help it work through those issues. now is it required that all maps be converted to grey scale before feeding it to crazy bump? or can one just open up the diffuse DDS map, have the program generate a normal map from it and then call it done?
Title: Re: normal maps....HOW?
Post by: Water on February 03, 2008, 01:11:14 pm
now is it required that all maps be converted to grey scale before feeding it to crazy bump? or can one just open up the diffuse DDS map, have the program generate a normal map from it and then call it done?
You can use the difuse map, but all the texture noise also gets bumped.
As an experiment - feed Crazybump an image with some overlapping squares (different colours/grey)- make sure some of them have a glow around them. Then look at the output - green from one direction, red from the other. As the surface changes you get a green area, when it changes again you lose green etc.

You may notice everything ends up with the same depth - only the strength of the change of "height" shows up. Normal maps don't do depth.

The MVP normal maps look stronger for game use compared to say a normal map for a model render.

Title: Re: normal maps....HOW?
Post by: Scooby_Doo on February 04, 2008, 01:52:58 am
Also why does height mapping mess up the texture?

without:
(http://img.photobucket.com/albums/v356/Shodan_AI/fs2_open_3_6_102008-02-0401-46-24-7.jpg)

with:
(http://img.photobucket.com/albums/v356/Shodan_AI/fs2_open_3_6_102008-02-0401-46-22-8.jpg)
Title: Re: normal maps....HOW?
Post by: Vasudan Admiral on February 04, 2008, 02:02:12 am
Can you post the texture, normal map and height map? I've suspected for a while now that heightmaps are not being applied properly, but if so it's mostly because coders haven't had good test maps, and I've been a bit too busy to make a test one.
Title: Re: normal maps....HOW?
Post by: blackhole on February 04, 2008, 02:05:02 am
If that hieghtmap is getting overly offset it seems like one of the constants in the shader might need to be adjusted? This has got to be a problem with the hieghtmap intensity, but I haven't looked at the parallax mapping code lately.
Title: Re: normal maps....HOW?
Post by: Scooby_Doo on February 04, 2008, 05:36:12 am
Here's one of the maps used: http://scoobydoo.freespacemods.net/Problems/maps.rar (http://scoobydoo.freespacemods.net/Problems/maps.rar)

Edit: also whats with the normal/height map moving around?  If you slowly go past the hull the normal map moves around like it was a liquid.
Double edit: definetely a height map issue, the problem disappears if I turn height maps off.
Title: Re: normal maps....HOW?
Post by: Hellstryker on February 04, 2008, 11:23:06 am
How the hell do you install that GIMP plugin?
Title: Re: normal maps....HOW?
Post by: Herra Tohtori on February 04, 2008, 11:45:35 am
Download the Windows binaries (assuming you're using Windows version of GIMP, otherwise you probably need to compile something, of which I don't know too much), open the zip file and read the manual:

Quote from: readme.txt
To install, extract normalmap.exe and glew32.dll to your GIMP plugins
directory.  Place libgtkglext-win32-1.0-0.dll and libgdkglext-win32-1.0-0.dll
in the C:\Program Files\Common Files\GTK\2.0\bin directory.


GIMP plugin directory is (usually) found at such intuitive place as C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins\.
Title: Re: normal maps....HOW?
Post by: Topgun on February 04, 2008, 03:02:06 pm
that doesn't work for me.
Title: Re: normal maps....HOW?
Post by: chief1983 on February 04, 2008, 03:42:16 pm
The normal map plugin link seems to be down, I pulled up the Google cached version and got the links from it.  Don't know if they're somewhere else.

Source (http://nifelheim.dyndns.org/~cocidius/download.php?filename=gimp-normalmap)
Home Page (http://nifelheim.dyndns.org/~cocidius/normalmap)
Windows binaries (http://nifelheim.dyndns.org/~cocidius/download.php?filename=gimp-normalmap-win32)

All links work as of this posting, I'd suggest going to the home page though, it seems more updated than the first link.

Also, you can convert to DDS with the Gimp DDS plugin or the Paint.NET DDS support (native to Paint.NET).  Here's the page for the Gimp DDS Plugin (http://nifelheim.dyndns.org/~cocidius/dds/).
Title: Re: normal maps....HOW?
Post by: Herra Tohtori on February 04, 2008, 03:49:48 pm
The normal map plugin link seems to be down, I pulled up the Google cached version and got the links from it.  Don't know if they're somewhere else.

Source (http://nifelheim.dyndns.org/~cocidius/download.php?filename=gimp-normalmap)
Home Page (http://nifelheim.dyndns.org/~cocidius/normalmap)
Windows binaries (http://nifelheim.dyndns.org/~cocidius/download.php?filename=gimp-normalmap-win32)

All links work as of this posting, I'd suggest going to the home page though, it seems more updated than the first link.

Huh, strange, that link worked earlier today. :nervous:

Quote
Also, you can convert to DDS with the Gimp DDS plugin or the Paint.NET DDS support (native to Paint.NET).  Here's the page for the Gimp DDS Plugin (http://nifelheim.dyndns.org/~cocidius/dds/).


I personally prefer the NVidia DDS Utilities (http://developer.nvidia.com/object/dds_utilities_legacy.html) (nvDXT) to GIMP plugin. The GIMP DDS plugin is a bit unclear about the file formats and compression methods - especially regarding DXT1a and DXT1c, as well as more obscure formats such as DXT5nm, which is required to get a normal map working under FS2_Open anyway.

Also, nvDXT offers quality switches and a load of other options that the GIMP plugin doesn't even hint about. But I do prefer the GIMP normal map plugin to, say, Crazybump. don't know why really... :nervous:
Title: Re: normal maps....HOW?
Post by: chief1983 on February 04, 2008, 03:55:31 pm
It actually seems that all of those Gimp plugins on registry.gimp.org aren't responding, the DDS one is down too which is why I linked the home page instead.  Maybe they got hacked.
Title: Re: normal maps....HOW?
Post by: blackhole on February 04, 2008, 06:04:35 pm
Its a heightmap issue, but the real question is, is it the fault of the hieghtmap itself, or the code thats interpreting the hieghtmap?
Title: Re: normal maps....HOW?
Post by: Vasudan Admiral on February 05, 2008, 02:44:17 am
Looks like it's the heightmap itself. :)

Scooby, your normal map is telling the game that the bumps on that texture are only small, and the pits only shallow. Your heightmap however is telling it the bumps are Mt Everest (pure white) and the pits are the Grand Canyon (pure black). ;)

So what the game is doing is shading it based on the normal map values (ie, a little bit), and shifting it based on the heightmap values (ie, a LOT) - which is why it looks so horribly wrong. Reducing the contrast does help a lot there, but this texture should not be using a heightmap basically.

As far as I can tell, the parallax mapping works just fine. We do still need a better test map to actually find out once and for all though.
Title: Re: normal maps....HOW?
Post by: Scooby_Doo on February 05, 2008, 05:36:35 am
Ugh, I wish I could find the original texture I used for that (what you see is a repetition of the orignal).  Then I could properly make bump map version wihtout running into the ever so slightly off problem I am having now.  And I have yet to find a better looking hull texture.  :blah:
Title: Re: normal maps....HOW?
Post by: bkd86 on February 05, 2008, 08:43:45 pm
If your converting your normal/ height maps from a texture make sure you change the contrast by about 50% (as in down) then make the map and then test and go from there. Some programs like the ATI normal map generator only work off of BW images (so does the height map) so this will solve some of your issues. Best way is to either model the detail in a high poly version to map to a lower poly or paint a texture layer specifically for normal map conversion that is mainly in greyscale. Painting specifically for a normal map will get rid of the grainy look some of the normal maps have.
Title: Re: normal maps....HOW?
Post by: Scooby_Doo on February 06, 2008, 11:36:33 pm
Ok I redid the textures, but I still have offsetting issues..

The windows look very funky.
(http://img.photobucket.com/albums/v356/Shodan_AI/Extras/height-problems.jpg)
Title: Re: normal maps....HOW?
Post by: Cobra on February 06, 2008, 11:42:19 pm
Don't put heightmaps on windows. :nervous:
Title: Re: normal maps....HOW?
Post by: Scooby_Doo on February 07, 2008, 01:29:57 am
Windows are part of the ship texture... I just wish it didn't shift everything.  The normal map looks great but when you add the height mapping eh.  Too bad displacement will never be supported or very efficent.  :sigh:
Title: Re: normal maps....HOW?
Post by: blackhole on February 07, 2008, 01:36:02 am
Quote
I just wish it didn't shift everything.

DO YOU WANT PARALLAX MAPPING OR DO YOU WANT A NORMALMAP?!
Title: Re: normal maps....HOW?
Post by: Vasudan Admiral on February 07, 2008, 01:39:13 am
Windows are part of the ship texture... I just wish it didn't shift everything.  The normal map looks great but when you add the height mapping eh.  Too bad displacement will never be supported or very efficent.  :sigh:
Dude, I've told you already a couple of times now: Don't apply a heightmap to flat textures. This is a flat texture. :p

You say it looks great with normal mapping - well leave it at that! You don't apply glowmaps to asteroids, so don't apply heightmaps to flat surfaces! :p