diff --git a/KREngine/KREngine/Shaders/ObjectShader.fsh b/KREngine/KREngine/Shaders/ObjectShader.fsh index fdacfb8..366e8ac 100644 --- a/KREngine/KREngine/Shaders/ObjectShader.fsh +++ b/KREngine/KREngine/Shaders/ObjectShader.fsh @@ -110,7 +110,7 @@ void main() mediump float lamberFactor = max(0.0,dot(lightVec, normal)); mediump float specularFactor = 0.0; //if(material_shininess > 0.0) { - specularFactor = max(0.0,pow(max(dot(halfVec,normal), 0.0), material_shininess)); + specularFactor = max(0.0,pow(dot(halfVec,normal), material_shininess)); //} #endif @@ -129,7 +129,7 @@ void main() #if DEBUG_PSSM == 1 diffuseMaterial = diffuseMaterial * vec4(0.75, 0.75, 0.5, 1.0) + vec4(0.0, 0.0, 0.5, 0.0); #endif - shadowMapDepth = texture2D(shadowTexture1, shadowMapPos).z; // unpack(texture2D(shadowTexture1, shadowMapPos)); + shadowMapDepth = texture2D(shadowTexture1, shadowMapPos).z; vertexShadowDepth = ((shadowMapCoord1 / shadowMapCoord1.w + 1.0) / 2.0).z; } #endif diff --git a/KREngine/KREngine/Shaders/ObjectShader.vsh b/KREngine/KREngine/Shaders/ObjectShader.vsh index 4b8884b..ec459d1 100644 --- a/KREngine/KREngine/Shaders/ObjectShader.vsh +++ b/KREngine/KREngine/Shaders/ObjectShader.vsh @@ -208,10 +208,7 @@ void main() // ------ Calculate per-vertex lighting ------ mediump vec3 halfVec = normalize((normalize(cameraPosition - myVertex) + lightDirection)); // Normalizing anyways, no need to divide by 2 lamberFactor = max(0.0,dot(lightDirection, myNormal)); - specularFactor = 0.0; - if(material_shininess > 0.0) { - specularFactor = max(0.0,pow(dot(halfVec,myNormal), material_shininess)); - } + specularFactor = max(0.0,pow(dot(halfVec,myNormal), material_shininess)); #endif #endif }