Looks like the light source is exactly behind the bleeding point, or is this just accidental in this image?
Ya i put it there to show the artifact.
Itās even more extreme if i mess with it a little set the pow(ā¦) to one. I can see a hour glass spray sort of image if i exasperate it to be as bad as possible.
Whats happening is the H value gets really warped when the average is close to zero. I canāt cut it off because that looks terrible and sliding it back requires blending which destroys the specular and twists it into diffuse.
Is (pixelToCamera + L) maybe just too close to zero for the normalize to work well?
Thats possible too, im thinking its when the light the pixel and the camera position are nearly aligned that roasts the H value. but im not sure there is a real fix either way.
Reading up on this i found that the way this blinn phong thing works it happens.
Its a real problem with it to were the solution is to set a very high specular power value.
Thats actually terrible im suprised its so popular, that basically defines broken.
Itās at pow 30 here in that image and the recommendation is to start at 50.
Im just about to reimplement my old one.
Edit here is my old one ts kinda hard to adjust it right.
I like the other one but i dont like that bleed thru.
Maybe later ill try to blend it in with mine and see if i can correct it and get that nice long edge glow. Mine can do it but its more of globular glow on the edge. i have no idea what they would call this. Its basically just a specular reflection using a actual reflection vector.
float4 PsLightShadowNormal(VsOutLightShadowNormal input) : Color
{
float3 pixelToCamera = normalize(CameraPosition - input.Position3D);
float3 pixelToLight = WorldLightPosition - input.Position3D;
float pixelToLightDist = length(pixelToLight);
pixelToLight = pixelToLight / pixelToLightDist; // cheapen a normalize.
float LightDistanceIntensity = 1.0f - saturate(pixelToLightDist / (IlluminationRange + 0.001f));
float shadowDepth = texCUBE(TextureDepthSampler, float4(-pixelToLight, 0)).x;
float4 TexelColor = tex2D(TextureSamplerA, input.TexureCoordinateA) * LightColor;
// shadow dunno if this is better then the if or not ?
LightDistanceIntensity = saturate( sign((shadowDepth + .2f) - pixelToLightDist) );
// lighting
float3 L = -pixelToLight;
float3 N = input.Normal;
float diffuse = saturate(dot(N, -L)); // the light to normal theta, this is the diffuse.
float3 R = reflect(L, N); // incidence vector of the light reflected via the surface normal.
float Rtheta = saturate(dot(-pixelToCamera, -R)); // theta for the reflected light against the pixel to camera normal
float Atheta = (dot(L, N) + 1.2f) *0.45f; // this is adjustable... given a range of -1 to 1 plus the first term * the second this should return at maximum 1.0.
float specular = pow(Rtheta, SpecularSharpness) * Atheta; // sharpen the specular range using it like this requires the strength to be doubled
//
float3 additiveAmbient = AmbientStrength;
float3 additiveDiffuse = diffuse * DiffuseStrength * LightDistanceIntensity;
float3 additiveSpecular = specular * SpecularStrength * LightDistanceIntensity;
float3 FinalColor = TexelColor * (additiveAmbient + additiveDiffuse + additiveSpecular);
return float4(FinalColor, 1.0f);
}