How to calculate this cpecular reflection?
HLSL
void calculateSpecular(
in float4 Normal,
in float4 SunLightDir,
inout float4 Specular
){
Specular = specularLevel * pow(saturate(dot(reflect(normalize(abs(eyePosition)), Normal), SunLightDir)), specularExponent);
}
/// in pixel shader
float4 Specular = float4(0.f,0.f,0.f,1.f);
calculateSpecular( input.normal, -sunLightDir, Specular );
///sunLightDir it's just camera position + vec3(0,10,0)
/// in vertex shader
output.normal = mul( float4( input.normal, 0.f ) , World );