Well summer is not really friendly to development or work in general, but I realised some people would probably like to already try doing some stuff so I won't delay it any further due to less relevant technical details.
First off you will need to grab the effect (
http://pastebin.ca/2077908), save this as arbitary plain text file in your client/effects directory ( I use 3D_SPecularMapping.fx )
You will also need to add following structure to your IOStructures.inc (this is text file as well)
struct VsToPs_3DNormal
{
float4 Position : POSITION;
float2 TexCoord : TEXCOORD0;
float3 Normal : TEXCOORD1;
};
Note - by chance this is exactly the same as 3DTangent and I'll reuse it correctly when I'm done with that, so this is just the part of WIP version and might be changed eventually, but I'm aware this is duplicate in this form :d.
When you are done with this, you shouldn't need to worry about effects themself, but if you want to edit them, turn of your client, delete effects cache (D3D allows saving shaders as binary data, saving some time, however nobody checks for anything, so you have to empty it to have them recompiled). If you cannot notice the effect, or have no shadows, check out fonline log file to see the error during compilation.
Now you need to use this effect. I expect some external definitions from fo3d file in my WIP version, so you should add it to your file
Here's example how to use effect, as well as to pass required value to your file
Effect 3D_SpecularMapping.fx
EffDef Floats Specular_Power 16.0
Model Armor_APA.x
And now one last thing - you need to specify specular texture to actually see anything, since texture 0 is already used by default shaders for diffuse part, and texture 1 for normal map, this shader uses texture 2 for specular maps.
So just append
texture 2 <path>
after texture 0 definitions and it'll correctly load.
Little tip to creating such texture: Transparency is calculated using normals on model, so you'r texture is supposed to cover whole model, and not just be diffuse texture with highlights painted on it. It's added on already calculated colors, so black parts will not actually darken anything, but just have no reflection appearing on it.
For metalic surface playing with levels should be enough, but for the best result you might want to actually paint the metal as if it was lit from every side.
Have fun with it, and post if you got any problem or questions, I'll add some effects and their variation later, and I'll answer questions about any effects, not just specular reflection, so if you got any idea feel free to ask.