Prevent double multiplication of Fresnel.

This commit is contained in:
Joey de Vries
2016-12-18 11:28:01 +01:00
parent 70f2ec7c1b
commit 0f78bb69ae
3 changed files with 7 additions and 7 deletions

View File

@@ -95,10 +95,10 @@ int main()
glm::vec3( 10.0f, -10.0f, 10.0f), glm::vec3( 10.0f, -10.0f, 10.0f),
}; };
glm::vec3 lightColors[] = { glm::vec3 lightColors[] = {
glm::vec3(5.0f, 5.0f, 5.0f), glm::vec3(2.0f, 2.0f, 2.0f),
glm::vec3(5.0f, 5.0f, 5.0f), glm::vec3(2.0f, 2.0f, 2.0f),
glm::vec3(5.0f, 5.0f, 5.0f), glm::vec3(2.0f, 2.0f, 2.0f),
glm::vec3(5.0f, 5.0f, 5.0f) glm::vec3(2.0f, 2.0f, 2.0f)
}; };
int nrRows = 7; int nrRows = 7;
int nrColumns = 7; int nrColumns = 7;

View File

@@ -111,7 +111,7 @@ void main()
float NdotL = max(dot(N, L), 0.0); float NdotL = max(dot(N, L), 0.0);
// add to outgoing radiance Lo // add to outgoing radiance Lo
Lo += (kD * albedo / PI + kS * brdf) * radiance * NdotL; Lo += (kD * albedo / PI + brdf) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again
} }
// ambient lighting (note that the next IBL tutorial will replace // ambient lighting (note that the next IBL tutorial will replace

View File

@@ -138,7 +138,7 @@ void main()
float NdotL = max(dot(N, L), 0.0); float NdotL = max(dot(N, L), 0.0);
// add to outgoing radiance Lo // add to outgoing radiance Lo
Lo += (kD * albedo / PI + kS * brdf) * radiance * NdotL; Lo += (kD * albedo / PI + brdf) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again
} }
// ambient lighting (note that the next IBL tutorial will replace // ambient lighting (note that the next IBL tutorial will replace