Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
For this specific case, the only option that I can immediately think of is writing a custom program that draws a 1024x1024 image of the normal map texture's red and green values, while it computes the blue colour based on the red and green colour. (Then again, I have done something slightly similar in the past, so that may be more appealing to me than most other people.)
That's actually what I was leaning towards. I got close with GIMP but it wasn't matching the reference image[squircleart.github.io] I was using. I was thinking of using Python but I don't really have a lot of experience beyond simple "Hello world" stuff. I did a little Jython a few years back but I don't remember any of it.
http://cpetry.github.io/NormalMap-Online/
That specific reference image is wrong for Source. The outer ring has a dark red value on the left and a bright red value on the right, implying that the inside of the ring is "stepping out" of the texture, while it has a dark green value on the bottom and a bright green value on the top, which in Source's case implies that the inside of the ring is "stepping into" the texture. Invert the green channel of the reference image, and then it'll be correct for Source.
Whoops. I had that backwards the whole time?
But regardless, I just need a method that will get the last third of that image from the first two thirds. It's not the one that's missing the blue, obviously. I was just using it to try and figure a method that would get perfect results on another image.
Either way, ignoring the blue colour channel, a black normal map colour in Source is up-left, and a yellow/white normal map colour in Source is down-right.
Again, it will usually be good enough with just a fully blue blue channel. If it doesn't look wrong in a 3D environment in Source, it's not worth the trouble trying to generate a "proper" blue channel from the red and green ones if you haven't done so in the past.
Then if you're real touchy about displaying right in source specifically go on and level the blue channel so the brightest value is 248.
Source does use the blue channel contrary to what a lot of people seem to believe.
You don't want to keep the green and red from the crazybump export as it has a habit of altering their intensity.
The new blue channel is also darker by exactly 1 for everything so that makes leveling a little harder (or it would if not for the fact a quick paintover of two 1% opacity brush puts it nicely at 248).
Source: Using VTFEdit to open a DXT5-formatted VTF texture, copying the image, pasting it, formatting it as BGR(A)888(8), comparing the two textures in an unshaded environment in Source, and noticing that the uncompressed texture is slightly darker in Source than the compressed one as the uncompressed one is not scaled up by ~3% while the compressed one is to balance out its max texture brightness to 100% display brightness.
TL;DR: Don't, because that's wrong.
The problem here is we're using something that did not come with a blue channel. It's inherently inaccurate. The leveling is something I do to help hide uv seams. Especially on mirrored boxes as source just hates having those flat.
Not that they'll display flat anyway since quake champions and source use different tangentspace (although converting between them is tedious. Especially since without the original blue channel you'll get some errors along the way) but it helps slighly and that's enough.
If this was something generated directly for source's tangentspace from something like handplane then yeah don't level that obviously.
If anyone is curious, the script looks like this:
convert input.png -channel B -fx "sqrt(1-((4*r^2-4*r+1)^2+(4*g^2-4*g+1)^2))" out/output.png
4*x^2-4*x+1 is the equivalent of using the curves tool in gimp to turn grays into black and the blacks & whites to white only (parabolic curve). Simply using r^2 and g^2 here doesn't work as that's the same as duplicating a layer over itself and changing the blend mode to multiply. The end result is very close but it's ever so slightly off. Here's[i.imgur.com] a comparison. The original blue channel is on the left, the one I get from the above expression is in the middle, and the right is the difference between the two.