SSR now keeps albedo color properly instead of fading to black

This commit is contained in:
Antoine Pilote
2023-09-17 20:14:37 -04:00
parent d45a0825a8
commit aa899f044f
2 changed files with 3 additions and 3 deletions

View File

@@ -27,5 +27,5 @@ void main()
vec4 a = texture(u_Source, UV);
vec4 b = texture(u_Source2, UV);
FragColor = vec4(vec3(a.rgb + b.rgb / 2.0), a.a * b.a);
FragColor = vec4(vec3(a.rgb + (b.rgb) / 2.0), a.a);
}

View File

@@ -272,7 +272,7 @@ void main()
// scale light by NdotL
float NdotL = max(dot(N, L), 0.0);
Lo += (kD * albedo / PI) * radiance * NdotL;// note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again
Lo += (kD * albedo / PI + specular) * radiance * NdotL;// note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again
}
/// ambient lighting (we now use IBL as the ambient term)
@@ -282,7 +282,7 @@ void main()
vec3 kD = 1.0 - kS;
kD *= 1.0 - metallic;
vec3 ambient = (kD * albedo) * (ao) * ssao;
vec3 ambient = (vec3(0.5) * albedo) * (ao)*ssao;
vec3 color = (ambient) + Lo;
// Display CSM splits..