Let's take the example below (from LearnOpenGL.com):
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32);
vec3 specular = spec * lightColor;
FragColor = texture(u_specMap, aTextCoord) * vec4(specular, 1.0f);
This does indeed work and makes the object shiny when the angle between the view and reflect vectors are close to being parallel (angle = 0 => cos(0) = 1).
But if I manually do the calculations it seems weird, like it tries to make attenuate the objects fragment color instead of amplifing it.
Lets see the following example:
lightColor = (1.0f, 1.0f, 1.0f);
dot(viewDir, reflectDir) = 0.99 (Almost parallel)
spec = pow( max(dot(viewDir, reflectDir), 0.0f), 32 )= 0.7249;
specular = 0.7249 * (1.0f, 1.0f, 1.0f) = (0.7249, 0.7249, 0.7249);
FragColor = texture(u_specMap, aTextCoord) * (0.7249, 0.7249, 0.7249, 1.0f);
If the texture sample point is black you get black: (0,0,0,1) * (0.7249, 0.7249, 0.7249, 1.0f) = (0,0,0,1)
if it's another color you get that color dimmed down to a darker shade of that color itself, since you multiply it with a uniform value of 0.7249 which is smaller than 1.
I can not see how this makes the shinny effect to occur. It should make it darker instead. Even if the dot product is exactly 1, you will just get (map.r, map.g, map.b, map.a) * (1,1,1) = the origina map sample color.
Thanks!