   Shader: My specular light floats into shadowed areas
  I thought I had a solid specular light implementation, but at a certain angle, the specular light, that I have implemented, floats into areas that it is not supposed to be in:This is how it looks (movie is ~1.4 MB): specular.wmvI also made a screenshot and highlighted the problem in red:This is what the pixelshader I use in the movie looks like (I programmed it after an example in "Programming Vertex and Pixel Shaders" by Wolfgang Engel, p. 106):float4 PS_light(float2 a_texcoord0: TEXCOORD0, float3 a_normal : TEXCOORD1, float3 a_world_position : TEXCOORD2) : COLOR{float4 l_basecolor = tex2D(g_texsampler0, a_texcoord0);float3 l_normal = normalize(a_normal);float4 l_diffuse = 0;float4 l_specular = 0;// first directionallightsfloat3 l_view_direction;float3 l_halfvector;l_view_direction = normalize(g_camera_position - a_world_position.xyz);l_halfvector = normalize(-g_directionallight_direction + l_view_direction);float Diff = saturate(dot(l_normal, -g_directionallight_direction));float Spec = pow(saturate(dot(l_normal, l_halfvector)), 25);l_diffuse = g_directionallight_diffuse * g_material0_diffuse * Diff;l_specular = g_directionallight_specular * g_material0_specular * Spec;return l_diffuse + l_specular;}In this test shader, the material power is hardcoded to 25 (in the pow()). The problem is much worse if the value is lower. At power 3, the entire surface lights up, when looking at it in the right angle.What the heck did I do wrong?Thanx in advance.   
  Your website doesnt work for me so i cant see the pics or movies, but I'm pretty sure I know what the problem is.This is an entirely normal phenomenon, and easily fixed.Most specular shaders use a shadowing term to prevent this. Simply do something like this:float shadow = saturate(4 * diffusevalue);specular=specular*shadow;This just takes the diffuse value, lightens it, and multiplies it with the specualr, ensuring that the specular highlight will fade off into the darker areas, but still be quite bright towards the edge..this should look correct in all circumstances.;  Thanx alot, that worked perfectly.What did you do to deserve 927 points?I will give you max, to correct it a bit :)   