title: Specular Mapping in OpenGL ES 2.0
body: <p>I am a new bid in the world of OpenGL ES 2.0. I am trying to implement specular mapping using OpenGL ES 2.0 on iOS platform. As per my knowledge,in specular mapping we extract the value for the specular component of light from specular map texture. What i am doing in vertex shader is as follows:</p>
  
  <pre><code>vec3 N = NormalMatrix * Normal;
  vec3 L = normalize(LightPosition);
  vec3 E = normalize(EyePosition);
  vec3 H = normalize(L + E);
  vec4 Specular=(texture2D(sampler_spec, TextureCoordIn)).rgba;
  
  float df = max(0.0, dot(N, L));
  float sf = max(0.0, dot(N, H));
  sf = pow(sf, Specular.a);
  
  vec3 color = AmbientMaterial + df * DiffuseMaterial + sf * Specular.rgb * SpecularMaterial;
  
  DestinationColor = vec4(color, 1);  `
  </code></pre>
  
  <p>But I can't see any specular effect in my game. I don't know where i am going wrong. Please give your valuable suggestions.</p>