Oh well this is just annoiyng me now. If only I was better at maths, lol.
Okay, something for you guys to try. It seems to be caused by shallow angles and since Mystic said it was specular I had a closer look at the shaders.
this is the ship specular function (in GS_Ship.fx, in pipleline effects dir)
float4 GetSpecularColor(float3 light, float3 normal, float3 view, float4 dataSample)
{
float cosang = max(dot(reflect(-light, normal), view), 0.00001f);
float glossScalar = dataSample.r;
float specularScalar = pow(cosang, g_MaterialGlossiness) * glossScalar;
return (g_Light0_Specular * specularScalar);
}
I want you to mod it to look like this (add the red line):
float4 GetSpecularColor(float3 light, float3 normal, float3 view, float4 dataSample)
{
float cosang = max(dot(reflect(-light, normal), view), 0.00001f);
cosang = min(cosang, 0.95f); // reduce the smallest possible angle by 5 percent - Aractain
float glossScalar = dataSample.r;
float specularScalar = pow(cosang, g_MaterialGlossiness) * glossScalar;
return (g_Light0_Specular * specularScalar);
}
On mine it reduces most of the problem but I only did a small test (note that the planets and other things have different shaders so only look at ships). I make backups and modify the one in the main directory for speed but I guess this works in a mod?
EDIT: More explanations
This only stops the situations where this occurs the most btw, I still don't know why its making the edges so white (I would have though the AA would blend them in more not make high brightness pixels).
When the values of the dot product between the light reflection vector and the lookat vector (the direction your camera is) go over 0.95 (max is 1.0) it makes white pixels for some reason (not sure if its always or there is some other modifier).
I thought the white pixels were 'random' on edges but it seems to be only on edges whows normal in facing such a way that it crates a reflection vector pointing very close to the camera and thus the bright pixels, the fact they appear as they do must be a bug with the AA or something.
Anyway I can't find any better ways to fix this atm other than limit those very close angles.