On forum: 08/26/2008
Normal maps in STALKER|
I'm looking for information on Normal Mapping in Stalker. I've read all the wiki pages, searched for hours. There doesn't seem to be any concrete explanation on the individual maps and shaders in STALKER. If anyone knows about posts on this form (the search feature is just crap) which answer my questions. Please link them. Without further ado..
I Started to play around with normal mapping in Stalker recently. Particularly the ones in SHOC. I'm using CrazyBump to generate normal maps from the diffuse color maps. For example. Taking act_stalker.dds, painting out the details I don't need to see the normal map for (eye in the goggles, etc), and throwing that map into CrazyBump, to get a nice normal map. I save that out as a .dds file.
I then bring that into Photoshop, since the alpha channel is white (cannot have this), I duplicate the RGB channel, gray scale it out (Adjustment Layer > Channel Mixer, and check Monochrome), copy / paste the result into the alpha channel, and delete the gray scaled layer. I'm now left with the RGB layer, and an RGB channel, red, green, blue, and alpha 1 channels.
I rearrange and rename the channels as per the FPS Bannana tutorial (http://www.fpsbanana.com/tuts/4507), this turns the Image into "Multilayer Mode", so I convert the image back to RGB mode (Image > Mode > RGB). The image at that point looks like the green normal map we'd expect to see work for STALKER. I go to save it out.
After messing around with the nvidia DDS plugin settings for the better part of yesterday. I discovered that I would save the file as either DXT3 or DXT5, and as soon as I saved it, and reopened it, the normal map was no longer the nice green color. It would go back to the blue/purple Tangent Space Normal map. What you have to do is disable this conversion in the options for the DDS file format window. While saving the file, click on Normal Map Settings, and disable the check box that says Convert to Tangent Space Normal. This will make sure your map stays the nice Green color that STALKER likes.
Now comes the part that confuses me. In the unpacked textures/act folder of STALKER, there's generally a _bump, and a _bump# map for every set of textures. Example act_stalker_bump.dds and act_stalker_bump#.dds. The _bump is the green normal map, like the one I made, but the _bump# looks like some strange gray scaled version of the same thing. Only it still has an RGB, red, green, blue, and Alpha 1 channel, as well as slight color information (some greens, and pinks), and is still in RGB mode...
Can anyone explain what the _bump# map correlates with in the shader? Is it the specular map? another bump map (would be weird since it doesn't make sense to use a Normal Map AND a bump map in the same shader)?
So far, I've been taking my created _bump map, running it through the Nvidia Normal Map Filter (Animate Light off, Alpha Field set to Height, Height Source set to Average RGB, and Scale to 5), which converts it back into the purple normal map. Then save it out as DXT5-NM, which gives me a grayscale image that looks close enough to what comes Packed in the STALKER texture directories.
Upon testing, this seems to work relatively well, but I feel like I can get even better results if I knew what _bump# was actually doing in the xray shader setup! Whoever can shed light on this would be most helpful!
Thanks for reading,