1attribute highp vec4 inVertex; 2attribute highp vec3 inNormal; 3attribute highp vec2 inTexCoord; 4 5uniform highp mat4 MVPMatrix; 6uniform highp vec3 LightDirection; 7uniform highp float MaterialBias; 8uniform highp float MaterialScale; 9 10varying lowp vec3 DiffuseLight; 11varying lowp vec3 SpecularLight; 12varying mediump vec2 TexCoord; 13 14void main() 15{ 16 gl_Position = MVPMatrix * inVertex; 17 18 DiffuseLight = vec3(max(dot(inNormal, LightDirection), 0.0)); 19 SpecularLight = vec3(max((DiffuseLight.x - MaterialBias) * MaterialScale, 0.0)); 20 21 TexCoord = inTexCoord; 22} 23