diff --git a/res/shaders/basic.frag b/res/shaders/basic.frag index e6f71e6..9919065 100644 --- a/res/shaders/basic.frag +++ b/res/shaders/basic.frag @@ -166,8 +166,8 @@ void computeShading( float diffuseShading = max(dot(normal, lightDir), 0.0f); // Specular shading - vec3 reflectDir = reflect(-lightDir, normal); - float specularShading = pow(max(dot(viewDir, reflectDir), 0.0f), u_material.shininess); + vec3 halfwayDir = normalize(lightDir + viewDir); + float specularShading = pow(max(dot(normal, halfwayDir), 0.0f), u_material.shininess); vec4 diffuseTex = texture(u_material.texture_diffuse0, v_texCoord); vec4 specularTex = texture(u_material.texture_specular0, v_texCoord); diff --git a/src/World.cpp b/src/World.cpp index 5bac0af..edf570e 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -20,7 +20,7 @@ World::World(ShaderProgram *shaderProgram) // This will be removed in future when gloss maps are implemented shaderProgram->bind(); - shaderProgram->setUniform("u_material.shininess", 32.0f); + shaderProgram->setUniform("u_material.shininess", 64.0f); shaderProgram->unbind(); }