Page 1 of 1

[How to] Specular maps in mods

Posted: 10 Nov 2014, 11:46
by Fix
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.

Re: [How to] Specular maps in mods

Posted: 10 Nov 2014, 16:20
by meuh21
:thx:

Will be very useful in the future (i'm too lazy to rework my old mods :oops: ).

Re: [How to] Specular maps in mods

Posted: 11 Nov 2014, 13:32
by BestNoob
Ahhhh nice thx :1010

Re: [How to] Specular maps in mods

Posted: 12 Nov 2014, 10:37
by Cerovan
The tuto has been added in the documentation: http://doc.maniaplanet.com/creation/skins/mods.html :thumbsup:

Re: [How to] Specular maps in mods

Posted: 18 Sep 2016, 19:26
by tnc1976
Fix wrote: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.
Fix Thx 4 the Tutorial and Tips !

I am working on a Mod with more details on some GFX, but sometimes i am confused about the Original Textures (D,N,S).

Normaly Smaps are DXT5 with Alpha chanel (right ?).

I extracted all Textures to a Folder... Why is the StadiumFabricS.dds a DXT1 Texture without Alpha ? was there an update on this one ? and where can i find it ?

If i create it new in the modwork folder as a DXT5 with alpha it still works, but is this Okay to use a DXT5 instead a DXT1 for a mod ? can this make any problem to others ?

Also i have a question about the resolution.. is it okay to size up some textures as example from 512*512 to a size of 1024*1024 ?

And why is the StadiumWarpAuvent2D.dds a 512*512 like the StadiumWarpAuvent2S.dds but the StadiumWarpAuventAlphaN.dds is just a 16*16 is it okay to scale it up to a 512*512 ? (in my mod it works).
Can any texture be upscaled ?¿ without having issues on low machines.....
ModWork
ModWork
ScreenShot15.jpg (561.35 KiB) Viewed 3646 times
ScreenShot12.jpg
ScreenShot12.jpg (673.07 KiB) Viewed 3646 times
ScreenShot09.jpg
ScreenShot09.jpg (649.98 KiB) Viewed 3646 times
ScreenShot04.jpg
ScreenShot04.jpg (692.11 KiB) Viewed 3646 times
Greets

Re: [How to] Specular maps in mods

Posted: 18 Sep 2016, 19:57
by maxi031
tnc1976 wrote: Also i have a question about the resolution.. is it okay to size up some textures as example from 512*512 to a size of 1024*1024 ?
Yes you can use any scale, you can even have different scales of D, S and N textures, but size must be power of 2.
tnc1976 wrote: And why is the StadiumWarpAuvent2D.dds a 512*512 like the StadiumWarpAuvent2S.dds but the StadiumWarpAuventAlphaN.dds is just a 16*16 is it okay to scale it up to a 512*512 ?
That texture is small probably because D texture has no fake geometry so normal map can be represented as 1 color.

Re: [How to] Specular maps in mods

Posted: 19 Sep 2016, 18:55
by tnc1976
Thx maxi031for the Information :thumbsup:
maxi031 wrote: That texture is small probably because D texture has no fake geometry so normal map can be represented as 1 color.
Now it has a nice Bump with a 512*512 NormalMap ;)

maxi031 maybe you know ?

My ModWork folder is getting full, since some days the AirshipD. is only shown as Black texture. If Packed in the Mod.zip it shows up.
Is there a limmit how much files can be in Modwork or any other issue ?

Greets

Re: [How to] Specular maps in mods

Posted: 19 Sep 2016, 22:26
by maxi031
I am glad you got it going.
tnc1976 wrote: My ModWork folder is getting full, since some days the AirshipD. is only shown as Black texture. If Packed in the Mod.zip it shows up.
You need to put all textures that you want to change there before you start game, if you add some new to the folder while game is on it will show as black in game, but if you replace existing one it will work ok.
tnc1976 wrote: Is there a limmit how much files can be in Modwork or any other issue ?
Number of files is irrelevant, i did it with all files possible and it worked.