Author Topic: Is this applicable? Normal Map Tutorial  (Read 2156 times)

0 Members and 1 Guest are viewing this topic.

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Is this applicable? Normal Map Tutorial
I'm not adept at normal mapping as of yet (hence this tut here) but I'd like to get
some feedback from folks that do know their stuff to see if this applies, what could be done
better, maybe mention if there's things that don't make since to do because the game won't handle
it, etc.

http://cg.tutsplus.com/tutorials/autodesk-3ds-max/how-to-bake-a-flawless-normal-map-in-3ds-max/

Fair warning, it's 45 minutes of a guy going back and forth doing a hi and lo poly normal bake in Max and PS.

First thing I noticed is the normals we've put in game have been a solid green, rather than the opalescent maps
the guy in the video uses. There a reason why, other than I assume the game won't accept it?
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 
Re: Is this applicable? Normal Map Tutorial
In short, FS2 normal maps are the same BUT with a removed and moved channel. This creates the green or gray effect. EVE-Online uses something very similar, only using X and Y normals. Honestly I have no idea why. I don't want to challenge the all powerful programmers we have here >_>, but having one channel in color and the other in alpha with nothing else put in... it kinda hurts filesize on my end. It treats the RGB channels as normal and adds on the additional filesize of the alpha channel.

Anyways they are basically the same, read the FS2 wiki or various tutorials here to understand how to make normal maps work for Freespace 2. Also the whole high poly projection thing can be done but I have done it to a degree myself. It varies between smooth goings or irritating mess. Perhaps this video can help sort out some annoying issues.
I have created a masterpiece.

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Is this applicable? Normal Map Tutorial
GCU Wall of Text has arrived in this system.



Normal maps used in FS2 are tangent space normal maps that only use two channels of information. Tangent space means that the normal map affects the surface's local normal vector (which is the normal of the surface's tangent plane).

There are other types of normal maps that can use two or three channels (three channels is enough to specify a vector in three-dimensional space, which means it can be used as object space normal mapping. These normal maps work a bit differently - namely, they specify the normal vector's direction in the object's reference frame rather than relative to the surface tangent plane at each pixel's mapped UV location.

But FS2 normal mapping uses tangent space normals, so two channels is enough. One channel contains the tilt of the surface on horizontal direction, and the other on vertical direction.

In the most typical tangent space normal maps, the normals information is in red and green channels, while blue is used to save some height information (which may or may not be used by the application). This results in the typical bluish-purple normal maps that most normal map plugins produce as tangent space normal maps. In this type of normal map, "flat" or unaffected surface normal vector results from either colour #7f7fff or #8888ff (RGB(127,127,255) or RGB(128,128,255)). On a range from 0 to 255, there's 256 values, which means there's no exact middle point that can be expressed as an integer, which means the middle point is somewhere between values 127 and 128.

As far as normal maps are concerned, the colour that is interpreted as "neutral" would depend on the shader system; I do not know how FS2_Open's normal map shaders do the math. I do know that GIMP's normal map plugin uses #7f7fff as the "flat" colour... but I digress.

For the shader mathematics, it doesn't matter how the information is delivered. In most cases, though, compressed textures deliver sufficient quality while reducing memory load by a whole lot, so using DXT compression is beneficial.

Now, DXT compression causes a certain amount of interaction between red, green and blue channels due to how the interpolation processes work. This means that what is in the red channel will affect the contents of green channel and vice versa. This isn't so bad in diffuse, shine and glow maps; however it is practically fatal for normal maps.

However, DXT formats with a proper alpha channel (DXT3 and DXT5 - DXT5 is typically better for normals) save the alpha channel distinct from the RGB compression.

Because of this, it is beneficial to save one channel of normal map information on the RBG side of the file, and the other channel is saved on the alpha channel. This means there's no crosstalk between the channels, and higher quality is achieved. Usually, red channel is transferred to alpha channel. Green channel information is either copied to red and blue channels (which results in "grey" normal maps) or alternatively, red and blue channels are filled with solid black to fill the channel information with a bunch of zeroes (which results in green normal maps).

In other words, to achieve best quality for the green channel, red and blue channels must be either identical to green, or they must contain no relevant information which is achieved by having them fully black.

This DDS format where green and alpha channel contain normals information is called DXT5_nm (nm like normal map). Functionally, it is exactly identical to the DXT5 compression, the only difference is the purpose. Some DDS converters include a DXT5_nm option; what this does is essentially throw the red channel to alpha, then either copy green to red/blue or fill red/blue with black, then save as DXT5. This can be done manually as well.

Some converters results in greenish, some in grayish normal maps as they are opened in image editor. Functionally, there's no difference, as only green and alpha channels are read.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Is this applicable? Normal Map Tutorial
ht pretty much explained it. couple details though. dxt* uses 5'6'5 rgb color which means that green gets an extra bit of precision over red or blue (this is because the human eye is more sensitive to green than any other color). the alpha channel in dxt5 i believe has 8 bit resolution. its better to use green and alpha than it is to use the other 2 channels because you get 1 and 3 extra bits of accuracy over red and blue. there is a somewhat newer map format called 3dc, which is a 2 channel format specifically for normal maps. it is essentially 2 dxt5 alpha channels and is the same size as dxt5. the only reason we dont use it is that its somewhat newer and not supported by older video cards. it has a small quality improvement over dxt5, and it doesnt waste any channels.

so if you come up with a technique to render a bluish redish purpleish normal map, it can be fairly easily converted to dxt5_nm with the photoshop plugins. or you can shuffle the channels manually. but i would save the normal maps initially in a lossless format like tga, and convert that to a dxt5_nm so you dont loose any quality to compression artifacts in the conversion.
« Last Edit: November 16, 2010, 08:09:16 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: Is this applicable? Normal Map Tutorial
So it was the intermingling of the channels? Heh never thought of that.
I have created a masterpiece.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Is this applicable? Normal Map Tutorial
pretty much. you just copy red to alpha, and copy green to red and blue (or black them out, im not sure which is better or if its even relevant), then save and convert it to dxt5.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN