Added back tonemapping

This commit is contained in:
Antoine Pilote
2024-04-28 18:17:09 -04:00
parent c55854ca61
commit 5216daed48
7 changed files with 361 additions and 310 deletions

View File

@@ -245,10 +245,9 @@ void main()
ssao = texture(m_SSAO, UV).r;
}
float emissive = texture(m_Emissive, UV).r;
if (unlit > 0.1f)
{
float emissive = texture(m_Emissive, UV).r;
FragColor = vec4(albedo * ssao * emissive, 1.0);
return;
}
@@ -341,7 +340,7 @@ void main()
vec3 kD = 1.0 - kS;
kD *= 1.0 - metallic;
vec3 ambient = (vec3(0.5) * albedo) * ao * ssao * u_AmbientTerm;
vec3 ambient = (albedo) * ao * ssao * u_AmbientTerm;
vec3 color = (ambient) + Lo;
// Display CSM splits..

View File

@@ -36,12 +36,12 @@ vec3 aces(vec3 x) {
void main()
{
vec3 color = texture(u_Source, UV).rgb;
vec3 mapped = vec3(1.0) - exp(-color * u_Exposure);
//color = vec3(1.0) - exp(-color * u_Exposure);
// reinhard
//color = color / (color + vec3(1.0));
// gamma correct
//color = pow(color, vec3(1.0 / u_Gamma));
color = pow(mapped, vec3(u_Gamma));
FragColor = vec4(color, 1.0);
}