mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Multiply ambient component with diffuse's surface (albedo) color.
This commit is contained in:
@@ -27,7 +27,7 @@ void main()
|
|||||||
float AmbientOcclusion = texture(ssao, TexCoords).r;
|
float AmbientOcclusion = texture(ssao, TexCoords).r;
|
||||||
|
|
||||||
// Then calculate lighting as usual
|
// Then calculate lighting as usual
|
||||||
vec3 ambient = vec3(0.3 * AmbientOcclusion);
|
vec3 ambient = vec3(0.3 * Diffuse * AmbientOcclusion);
|
||||||
vec3 lighting = ambient;
|
vec3 lighting = ambient;
|
||||||
vec3 viewDir = normalize(-FragPos); // Viewpos is (0.0.0)
|
vec3 viewDir = normalize(-FragPos); // Viewpos is (0.0.0)
|
||||||
// Diffuse
|
// Diffuse
|
||||||
|
|||||||
Reference in New Issue
Block a user