Specular, Ambient and Normal Maps in TW3 - The Beginner's Guide.

+
Specular, Ambient and Normal Maps in TW3 - The Beginner's Guide.

This is not in any way an official guideline - it was created through experimentation. And it's from the original modkit, not the one released in October 2015. So if there's something incorrect just say so and I'll edit the post.

I'm sure most of the experienced modders already know this, but I had to spend a lot of trial and error working out exactly HOW the maps all worked together, so I thought I may as well share.


Specular Map - s01 - usually 1024x1024, RGB with no alpha channel. This is ADDITIVE to the diffuse map.
Influenced by:
- Ambient Map (see below)
- Alpha Channel in the Normal Map (varies the amount of specularity based on height.)
- The values in the mesh XML file for SpecularColor for the material concerned. (Probably other stuff too, but this is all I looked at)

The specular colour you will see on the final version can be calculated by ADDING the number from the diffuse, specular map and SpecularColor from the XML
So if diffuse is 17,2,0, the specular map is 48.42.42 and the SpecularColor value is 47,44,40 the final specular value will be 112,88,82.

The deeply-shaded occluded colour you will see on the final version can be calculated by adding the diffuse and specular map values, and then SUBTRACTING the SpecularColor value, so on the same example, it would be 18, 0, 2

Tiny changes in the numbers make a big difference.

So:
If you want the shine and the shadow BOTH to be the same colour as the original:
- Specular Map should be of a similar colour to the diffuse. (so if the diffuse is reddish, the specular map should also be reddish)
- The ratio between R, G and B should be similar on the Specular Map and on SpecularColor in the XML.
- The values for R, G and B on SpecularColor should all be HIGHER than they are in the Specular Map

If you want the shine and the shadow to be DIFFERENT colours to the original:
- A colour shift in SpecularColor (XML) will INCREASE that colour in the specular, but DECREASE it in shade.
- A colour shift in the Specular Map will INCREASE that colour in both specular and shade.

If you want to see the effect in Photoshop, you can see it by adding layers for the specular map and for SpecularColor on top of the Diffuse. Set the Specular Map layer to Linear Dodge and SpecularColor to either LinearDodge or Difference.

Ambient Map - a01 - usually 2048x2048, RGB with no alpha channel. Red uses the full greyscale, Green is always 0, Blue is usually either 0 or 255 but may be greyscale.
I'm not 100% sure on this, but from testing:

- Blue impacts on the specularity and shade that comes from texture "grain" in the normal maps. It determines the blend between two DetailNormal maps (see the XML file). If there's no blue, Normal2 is used. If blue is 255, Normal1 is used. Values between this blend the two maps (I think). If the material only has one DetailNormal map, then setting the value to 0 will give you a smooth surface with no detail.

As well as being used for blending, this is used where a material needs two different textures, for example a cloth fabric jacket with a leather trim, or the striped jackets where the fabric weave is different.

- Red is used to indicate the amount of shadow/occlusion. Unless you're modifying normal maps, you probably won't want to touch this.

- Green doesn't do anything.

The Normal Map is RGBA, usually 2048x2048. The only part I'm covering here is the alpha channel.
Dark pixels in the alpha channel result in increased specularity, so this is presumably SUBTRACTED from the other specularity information.
The alpha in the Normal Map is NOT apparently used for height information, so as long as you stay clear of the RGB channels, you shouldn't mess anything up.

Problem with Normal Maps, specularity and wcc_lite
From personal experience only. YMMV. I've had the problem using all three main Normal Map image formats (TGA, DDS and PNG). The workround is tested only with TGA. This is an "amateur solution", I'm sure there are better ways of dealing with it, but it worked for me ;)

Problem: If you re-import a normal map into a mod, even if you haven't changed anything on it, the specular goes crazy - very bright specular patches even in places where it should be minimal.

Workround:
Edit the alpha channel in the normal map to filter out very high and very low values. In Photoshop, I used levels to do it, with output values in the range 100 - 220, but you'll need to play around with it. The important thing is to make it a LOT paler without losing too much data.

If there are areas on the map that must be very bright, in theory you should be able to mask them out first, but I found that if there were any dark pixels at all, it imported incorrectly.

You'll probably need to play around with the specular map and the XML parameters to fix whatever is now too dull.

If the model you're working on doesn't have a specular map, you can create one and add it to get more control over the detail. Adding one does mean more edits on the XML parameters though - use another XML file as your guideline for what parameters need to be set. (you may also need to use a different pbr file as base, so watch for that.)


EDIT: THIS MAY HAVE BEEN FIXED IN THE MODKIT UPDATE - PLEASE POST IF YOU HAVE NEWER INFO
 
Last edited:
Note to reds randomly stumbling upon this post :3 :
Classic model is based on diffuse, specular and specular power. PBR model is based on albedo, roughness and metalness. Using parralax corrected IBL from multiple reflection probes + screen space reflections doesn't make those shaders PBR as far as my knowledge goes :)
 
And I have no idea what you just said, but I'm guessing it's the reason why every piece of advice on "how specularity works" I googled didn't seem to apply, and why I had to determine all of this by trial and error?
 
And I have no idea what you just said, but I'm guessing it's the reason why every piece of advice on "how specularity works" I googled didn't seem to apply, and why I had to determine all of this by trial and error?

So a PBR model is one based on how the material physically interacts with light in the real world, and accurately representing it in a game engine. This involves different maps from classic models. You may have the same mesh, but a classic model's lighting is based on specularity and a PBR model's lighting is based on texture (as in the roughness and metalness - the physical "feel" of the surface) one could say this is the fundamental line where we cross from pre-baked to truly dynamic lighting.

This is my understanding. It might be wrong, but I hope it helps.
 
So a PBR model is one based on how the material physically interacts with light in the real world, and accurately representing it in a game engine. This involves different maps from classic models. You may have the same mesh, but a classic model's lighting is based on specularity and a PBR model's lighting is based on texture (as in the roughness and metalness - the physical "feel" of the surface)

This is my understanding. It might be wrong, but I hope it helps.

Thanks. There's a reason why I included "Beginner's" in the title, and I definitely need things translated to "Simple".

I was also hesitant to make this thread, with a long internal argument between "It might help someone avoid the errors I made" and "But I could be wrong about this..." going through my mind repeatedly. So if any of you REAL experts can add to it, or correct anything I got wrong, please, please do so.
 
Thanks. There's a reason why I included "Beginner's" in the title, and I definitely need things translated to "Simple".

I was also hesitant to make this thread, with a long internal argument between "It might help someone avoid the errors I made" and "But I could be wrong about this..." going through my mind repeatedly. So if any of you REAL experts can add to it, or correct anything I got wrong, please, please do so.

No problem, but I'm not an expert on textures. Hell, I wouldn't mod them with a ten foot pole. I stick to models myself, and level design. I hand greyboxes off to partner modders who know what they're doing in the photoshops.
 
I hope this is the right thread for my question :)

So the files ending with _a in the characters texture folders are what exactly? They seem to have ambient and specular maps in the channel, or what are these maps doing? And the map in the R-channel is more than an ambient map? Because I'm still trying to figure out from which maps the 'SSS' effect in game is controlled etc. And somehow every character has a stronger specularity than Geralt. Especially when it rains. Geralts face stays less wet. Somehow.

I hope I can add a bit more glossy gloss to Geralts face. But let's see what you guys are knowing about these maps? :p
 
I hope this is the right thread for my question :)

So the files ending with _a in the characters texture folders are what exactly? They seem to have ambient and specular maps in the channel, or what are these maps doing? And the map in the R-channel is more than an ambient map? Because I'm still trying to figure out from which maps the 'SSS' effect in game is controlled etc. And somehow every character has a stronger specularity than Geralt. Especially when it rains. Geralts face stays less wet. Somehow.

I hope I can add a bit more glossy gloss to Geralts face. But let's see what you guys are knowing about these maps? :p

It's a good place to discuss it :)

Yes, it's the ambient map, but they do seem to be using the maps in a slightly non-standard way, hence my first post. (I couldn't find anything in google that seemed to be accurate for this game).

As far as SSS is concerned, there's references to it on the material XML that goes with each mesh, so it can be edited there. I haven't seen any examples where they've used maps rather than just values, but then I've been looking mainly at armour.

For specularity generally, the XML file is pretty important, you always seem to need to edit there, not just on the specular map. I don't how how they decide how much effect rain has.
 
This is so nice!
I'm trying to make a mod and I want a transparency alpha map. I've read the post but I don't know if the diffuse map also has alpha transparency channel? Or should I make the transparency with the normal map?
 
Hey Gregor! From what I can see, at the center of the back the normal shows up but not the diffuse. Have you checked if you missed anything with materials, included alpha when importing or with uvs? Can't really think of anything else at the moment.

Maybe a shout out to ScoutBr0 or paulscotttt could help...
 
Any news on this? I really don't knwo what I can do about it. I already tried different normal maps (created new ones from scratch, from diffuse, from vanilla heightmap) but nothing helps. I also tried to invert the normal map (green and red channel) but nothing.... Maybe it is a problem with material? But what exactly?
 
Hey GregorWladacz, downloaded your files but I don't know if I will have free time to check them soon. The texture files seem a bit large imo. Have you made sure they fit within w3 texture specifications?
 
hm, I don't know. I just increased the reolution of the textures to 4k. I honestly didn't know there could be problems with it....
 
HalkHoganPL Since you make alot of textures i have a question for you. Does this workaround still work for fixing corrupted normal maps? I tried to do as the first page said by increasing the output level values on low and decreasing the high values. Tried it two different times and my texture on the cat armor is around 80% transparent. if i take the normal map out my armor is just fine. The other hex editing method for normal maps seems to complicated for me.
 
Top Bottom