I saw that somebody made a tool to convert standard normal maps into the format that is used by the SC2 engine, but is there a tool that converts normal maps from the engine into regular normals? If not, can I do it by hand and if so, how do I do it?
I haven't worked with sc2 normal maps at all, but from what I can see, they have the green and alpha channels with stuff in them.. Assuming they corrospond to the x and y of the normal map, and that the normals should be unit vectors, you could copy the alpha back into the red layer, invert the green (if it was inverted when creating the sc2 normal map), and then calculate the blue based on the red and green.
Having the rgb colors in the range [0, 1]
r = a
r = r * 2 - 1
g = g * 2 - 1
b = sqrt(1 - r*r+g*g)
r = r/2 + 0.5
g = g/2 + 0.5
b = b/2 + 0.5
If r*r+g*g ever becomes > 1, then there is really no way it could be a unit vector.. you could assume that the b should be 0, and then normalize the vector, or you could assume that the b should be 1 always (although that would make it impossible to make normals lie down, so I don't think that is the case).
I don't think it can be done in photoshop, but it is possible to make a program to convert it back.. if those assumptions hold.
Just to prove it, I made this quick program.
It can't read the dds format from sc2 though, so use photoshop to convert the pixel format to 220.127.116.11 ARGB
Awesome! Now how do I use it? :) I tried opening a .TGA version of the normal with the program which did nothing, and if I just double click the .exe, I get the message that the program has stopped working (Windows 7 x64) . If you could get this program to work for me I would be eternally grateful.
Yeah, I didn't have XNA 3.1.0 installed, that did the trick :) Now to go though 250 normal maps ^^
BTW, I don't know if you're familiar with the spec maps, some of them are just fine, like this one:
Others have some weird shit in their blue channel, like this one:
Do you have any idea what's going on there? So far what I've been doing is just deleting the blue channel and then taking the remaining channels like they are if they're usable. Sometimes though it just returns unusable color which I "fix" by just turning it greyscale (or just copying the red channel into the rest of the channels, effectively giving me a greyscale image as well). Hope you have any insights on this, and again, I can't thank you enough for the normal map converter :)