Skip to content

Commit

Permalink
Ensure tone mapping clamps after gamma correction, not before.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jan 3, 2025
1 parent f828afb commit c65222a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions data/tone-map/hdr-tone-mapping.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ vec3 tone_map(vec3 color);

void main(){
color = texture(previous_pass, uv);
vec3 mapped = clamp(pow(tone_map(color.rgb), vec3(inv_gamma)), vec3(0), vec3(1));
color = vec4(mapped, color.a);
color.rgb = clamp(pow(tone_map(color.rgb), vec3(inv_gamma)), vec3(0), vec3(1));
}

0 comments on commit c65222a

Please sign in to comment.