This commit is contained in:
Benjamin Kyd
2019-02-20 18:34:36 +00:00
parent b36dd004dc
commit 84d7bb4b7e
4 changed files with 75 additions and 48 deletions

View File

@@ -12,8 +12,9 @@ uniform sampler2D diffuseTexture;
uniform sampler2D shadowMap;
vec3 viewPos = vec3(0.0, 0.0, 0.0);
vec3 objectColour = vec3(0.58, 0.61, 0.627);
vec3 lightColour = vec3(0.1, 0.45, 0.9);
vec3 objectColour = vec3(1.0, 1.0, 1.0);
vec3 lightColour = vec3(1.0, 1.0, 1.0);
// vec3 lightColour = vec3(0.1, 0.45, 0.9);
float calculateShadow(vec4 fragPosLightSpace) {
vec3 projCoords = fragPosLightSpace.xyz / fragPosLightSpace.w;
@@ -33,7 +34,7 @@ void main() {
vec3 diffuse = diff * lightColour;
float specularStrength = 5;
float specularStrength = 0.2;
vec3 viewDir = normalize(viewPos - FragPos);
vec3 reflectDir = reflect(-lightDir, normal);
@@ -42,7 +43,7 @@ void main() {
vec3 specular = specularStrength * spec * lightColour;
float ambientStrength = 0.2;
float ambientStrength = 0.1;
vec3 ambient = ambientStrength * lightColour;
float shadow = calculateShadow(FragPosLightSpace);