[How to] Specular maps in mods

Discuss everything related to custom data creation.

Moderator: NADEO

Post Reply
Fix
Nadeo
Nadeo
Posts: 1251
Joined: 14 Jun 2010, 17:28

[How to] Specular maps in mods

Post by Fix » 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.

User avatar
meuh21
Posts: 1268
Joined: 15 Jun 2010, 17:00
Location: Dans mon champ...
Contact:

Re: [How to] Specular maps in mods

Post by meuh21 » 10 Nov 2014, 16:20

:thx:

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

User avatar
BestNoob
Posts: 196
Joined: 08 Mar 2013, 12:04
Contact:

Re: [How to] Specular maps in mods

Post by BestNoob » 11 Nov 2014, 13:32

Ahhhh nice thx :1010
To join my TM Servers, search for: bestnoob :thumbsup:

User avatar
Cerovan
Posts: 2044
Joined: 11 Jul 2011, 11:27
Location: France
Contact:

Re: [How to] Specular maps in mods

Post by Cerovan » 12 Nov 2014, 10:37

The tuto has been added in the documentation: http://doc.maniaplanet.com/creation/skins/mods.html :thumbsup:
Online Programmer & Meme Master ヾ(⌐■_■)ノ

Access to your Player Page

You have troubles, please contact the Ubisoft Support

Maniaplanet Documentation (Editors, Scripting, Title Pack, etc...)

tnc1976
Posts: 147
Joined: 06 Aug 2011, 16:52
Location: Germany

Re: [How to] Specular maps in mods

Post by tnc1976 » 18 Sep 2016, 19:26

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.....
ScreenShot15.jpg
ScreenShot12.jpg
ScreenShot09.jpg
ScreenShot04.jpg
Greets
You do not have the required permissions to view the files attached to this post.

User avatar
maxi031
Posts: 367
Joined: 17 Jul 2011, 00:55

Re: [How to] Specular maps in mods

Post by maxi031 » 18 Sep 2016, 19:57

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.
My specs:
MOBO: MB AM3+ 970 Gigabyte GA-970A-DS3P
CPU: AM3+ AMD FX-8320E
GPU: Nvidia GeForce GTX750-Ti ASUS 2GB DDR5
RAM: DDR3 8GB 1866MHz Kingston HyperX
SSD: SATA3 120gb SanDisk
OS: Windows 7 Profesional SP1 64-bit OS
TY MICMO

tnc1976
Posts: 147
Joined: 06 Aug 2011, 16:52
Location: Germany

Re: [How to] Specular maps in mods

Post by tnc1976 » 19 Sep 2016, 18:55

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

User avatar
maxi031
Posts: 367
Joined: 17 Jul 2011, 00:55

Re: [How to] Specular maps in mods

Post by maxi031 » 19 Sep 2016, 22:26

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.
My specs:
MOBO: MB AM3+ 970 Gigabyte GA-970A-DS3P
CPU: AM3+ AMD FX-8320E
GPU: Nvidia GeForce GTX750-Ti ASUS 2GB DDR5
RAM: DDR3 8GB 1866MHz Kingston HyperX
SSD: SATA3 120gb SanDisk
OS: Windows 7 Profesional SP1 64-bit OS
TY MICMO

Post Reply

Return to “Title Pack & Custom Data Creation”

Who is online

Users browsing this forum: No registered users and 1 guest