[How to] Specular maps in mods
Posted: 10 Nov 2014, 11:46
It's not a very long tutorial yet, but here are some hints that could help modders.
Some modders are using the diffuse map as specular map, this can work a little bit, but the best results are really obtained by doing each specular channel separately.
We are not using a real PBR technique (PBR = Physically Based Rendering) which is used nowadays alot in current and nextgen engines, but we are using similar concepts in the maniaplanet engine.
You can learn a lot from PBR tutorials, especially how light works and interacts with materials.
google search for PBR tutorials
http://www.marmoset.co/toolbag/learn/pbr-theory
In our engine, you could translate the PBR like this :
1-we don't have metals like PBR"s
2-Albedo = Diffuse
3-Microsurface = Specular exponent = Specular's Alpha channel = glossiness / roughness (black = rough, white = glossy)
4-Reflectivity = Specular intensity = Specular's Green channel (black : matte, white = shiny)
5-Fresnel = Specular's Red channel (black = low, white = high) (the color shown by our fresnel is given by the lightmap, it's a very low quality averaged color of the world around the pixel)
6-Ambient occlusion : is computed in the lightmap
work your specular map in RGB becasue most filters/modifiers don't touch the alpha channel:
RGB = FIE
Red = Fresnel
Green = Intensity
Blue = Exponent
before saving your map as .dds, convert it to RGBA=FI0E (0=zero).
This means cut/paste your Blue channel into Alpha channel, and set your blue channel to black.
some random Tips :
-unless really wanted, avoid too high exponent, makes everything wet or plastic
-be cautious with the specular intensity, this can makes very bright spots.
-the fresnel helps reading the volumes but adds a faery/virtual/toonish look to your material if too strong
-wet materials are darker than when they're dry, to simulate a puddle of water on the road : darken the diffuse, very strong fresnel, very high exponent, and high intensity (normal map of water/liquid should be flat (rgb = 127.127.255))
-to simulate oil : use a very dark almost black diffuse, and treat it like water. use brown for mud.
-in some "stoneish" materials, the brighter parts are more matte than the other ones (expecially true for concrete) : if you use your diffuse as a source for your specular, invert its glossiness values (bright diffuse = dark exponent/ intensity)
- asphalt as often an inversed specular : dark asphalt is shiny/new, and bright/grey asphalt is old, matte.
-do not apply the same modifications(brightness/contrast/curves, etc...) to the 3 channels of the specular maps, you'll have deeper and more interesting results if they are not synchronized (I use Curves adjustment in photoshop, and I tweak the curve for Red Green and Blue separately.
Some modders are using the diffuse map as specular map, this can work a little bit, but the best results are really obtained by doing each specular channel separately.
We are not using a real PBR technique (PBR = Physically Based Rendering) which is used nowadays alot in current and nextgen engines, but we are using similar concepts in the maniaplanet engine.
You can learn a lot from PBR tutorials, especially how light works and interacts with materials.
google search for PBR tutorials
http://www.marmoset.co/toolbag/learn/pbr-theory
In our engine, you could translate the PBR like this :
1-we don't have metals like PBR"s
2-Albedo = Diffuse
3-Microsurface = Specular exponent = Specular's Alpha channel = glossiness / roughness (black = rough, white = glossy)
4-Reflectivity = Specular intensity = Specular's Green channel (black : matte, white = shiny)
5-Fresnel = Specular's Red channel (black = low, white = high) (the color shown by our fresnel is given by the lightmap, it's a very low quality averaged color of the world around the pixel)
6-Ambient occlusion : is computed in the lightmap
work your specular map in RGB becasue most filters/modifiers don't touch the alpha channel:
RGB = FIE
Red = Fresnel
Green = Intensity
Blue = Exponent
before saving your map as .dds, convert it to RGBA=FI0E (0=zero).
This means cut/paste your Blue channel into Alpha channel, and set your blue channel to black.
some random Tips :
-unless really wanted, avoid too high exponent, makes everything wet or plastic
-be cautious with the specular intensity, this can makes very bright spots.
-the fresnel helps reading the volumes but adds a faery/virtual/toonish look to your material if too strong
-wet materials are darker than when they're dry, to simulate a puddle of water on the road : darken the diffuse, very strong fresnel, very high exponent, and high intensity (normal map of water/liquid should be flat (rgb = 127.127.255))
-to simulate oil : use a very dark almost black diffuse, and treat it like water. use brown for mud.
-in some "stoneish" materials, the brighter parts are more matte than the other ones (expecially true for concrete) : if you use your diffuse as a source for your specular, invert its glossiness values (bright diffuse = dark exponent/ intensity)
- asphalt as often an inversed specular : dark asphalt is shiny/new, and bright/grey asphalt is old, matte.
-do not apply the same modifications(brightness/contrast/curves, etc...) to the 3 channels of the specular maps, you'll have deeper and more interesting results if they are not synchronized (I use Curves adjustment in photoshop, and I tweak the curve for Red Green and Blue separately.