Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Nighteyes on August 31, 2009, 07:50:34 pm

Title: Question about Normal maps
Post by: Nighteyes on August 31, 2009, 07:50:34 pm
Hi, I've just noticed the big difference from using normal maps in game vs using a bump map in 3ds max...
for some reason the bump maps give models much more detail... is this a problem with the way we generate Normal maps? or are bump maps better in this regard?
Title: Re: Question about Normal maps
Post by: Fury on September 01, 2009, 07:15:41 am
Normal mapping is just a sub-type of bump mapping. Normal mapping is same as Dot3 bump mapping. The two most commonly used bump mapping methods are normal mapping and parallax mapping, also called offset mapping or virtual displacement mapping. Depending on type of bump mapping, different qualities can be achieved. But it is a different matter whether it is efficient to be used in-game and rendered in real-time.

And from the looks of it, this was all explained in wikipedia too. :p
Title: Re: Question about Normal maps
Post by: Nighteyes on September 01, 2009, 08:23:20 am
I know the difference between normal, parallax and bump mapping thank you :P
What I was asking is, wont it be easier to use a black and white texture for the hight map, because thats what I'm doing with 3ds max and the results are much nicer...
Or, maybe there is a way to add the texture detail into the normal map? so in the end it will have the same results? :P
Title: Re: Question about Normal maps
Post by: Qent on September 01, 2009, 08:42:44 am
Maybe this thread (http://www.hard-light.net/forums/index.php?topic=62705.0) could be useful. It sounds kind of like what you're talking about.
Title: Re: Question about Normal maps
Post by: Herra Tohtori on September 01, 2009, 08:50:18 am
I don't understand what you mean by lack of detail.

Could you show screenshots of same model in Max and in FS2_Open?
Title: Re: Question about Normal maps
Post by: Nighteyes on September 01, 2009, 10:10:38 am
Here, both are using exactly the same textures:
In-game model
(http://img12.imageshack.us/img12/7246/sbkasdeya.png)
By gbtf67 (http://profile.imageshack.us/user/gbtf67) at 2009-09-01

3Ds max
(http://img196.imageshack.us/img196/4432/87626956.png)
By gbtf67 (http://profile.imageshack.us/user/gbtf67) at 2009-09-01
Title: Re: Question about Normal maps
Post by: peterv on September 01, 2009, 10:20:20 am
Nighteyes is your launcher set to show normal maps ingame?
Title: Re: Question about Normal maps
Post by: Herra Tohtori on September 01, 2009, 11:25:38 am
I also find they work better when they are turned on.

If you have normals enabled on launcher, the first troubleshooting procedure would be to first check that the normal maps are in correct format (normals information in green and alpha channel, not red and green like the standard normal map) and correct directory, and have the correct file name and identifiers. As in texture-normal.*

If the maps are in correct form and format and the game is set to use them, check if OpenGL init enables GLSL. If it doesn't, the reason is likely that the shaders are missing, corrupt or somehow incompatible with your version of FS2_Open, or some such stuff.

In this case I might actually guess that the normal map is a purple standard-style normal map with no alpha channel, in which case the shaders cannot use it at all. But I could be wrong. :nervous:
Title: Re: Question about Normal maps
Post by: Dragon on September 01, 2009, 11:54:44 am
It seems that it's from Earth Defence, it's (or at leats the demo was) a standalone, so it's likely that someone forgot to include shaders with it.
If they're present try saving normal maps as DXT5n, it will automatically add all changes required for normal map to work.
A good method of checking if normal maps are working is to look at "render options" in the lab, if you have them enabled you can disable them and check if it has any effect.
Title: Re: Question about Normal maps
Post by: Snail on September 01, 2009, 11:55:46 am
It seems that it's from Earth Defence, it's (or at leats the demo was) a standalone, so it's likely that someone forgot to include shaders with it.
If they're present try saving normal maps as DXT5n, it will automatically add all changes required for normal map to work.
A good method of checking if normal maps are working is to look at "render options" in the lab, if you have them enabled you can disable them and check if it has any effect.
It's not the shaders; other ships work fine.

The current Earth Defense is not standalone, either.



EDIT - Honestly I think it's just a difference in lighting settings between 3DS and FS2... The normal maps are working in FS2 - They're just not as pronounced as they are in 3DSmax. You can tell this by turning off diffuse, glow, shine and env mapping, and toggling normal maps on and off. The normal maps are having an effect, just not as strong an effect as expected.
Title: Re: Question about Normal maps
Post by: Herra Tohtori on September 01, 2009, 12:03:31 pm
Then I would suggest looking into the texture properties. If other ships show the normal maps, then either the game doesn't find that particular normal map, or there's something wrong with the texture (like lack of alpha channel).

Also, using dxt5nm is something I deeply dislike. First of all it's an automated shortcut to a very simple procedure in swapping the places of the channels in the image, secondly it forces the use of dxt5 compression which is, with some normal maps (and especially with shiny ships), something that affects the quality quite a bit in the negative direction. I much prefer hand-managing the channels, because that way I can select the compression if it suits the map, and uncompressed formats still work if necessary.

TGA works just fine for viewing WIP normal maps as long as you move red channel contents to alpha channel... it doesn't need to be in DDS even.

Also, if the texture itself actually works, using higher scale value in converting from height to normal map might help.
Title: Re: Question about Normal maps
Post by: peterv on September 04, 2009, 11:55:09 am
The model ingame :

(http://img42.imageshack.us/img42/2336/kig.jpg)