Skip to content

Commit

Permalink
Fix reinhard and schlick tone mappers
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jan 4, 2025
1 parent c65222a commit 9e0be4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/tone-map/reinhard-extended.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ uniform float c_white;
vec3 tone_map(vec3 color){
float l_in = color_luminance(color);
float l_out = (l_in / (1.0 + l_in / (c_white * c_white))) / (1.0 + l_in);
return color / l_in * l_out;
return (color / l_in) * l_out;
}
2 changes: 1 addition & 1 deletion data/tone-map/reinhard.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
vec3 tone_map(vec3 color){
float l_in = color_luminance(color);
float l_out = l_in / (1.0 + l_in);
return color / l_in * l_out;
return (color / l_in) * l_out;
}
4 changes: 2 additions & 2 deletions data/tone-map/schlick.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ uniform float p, hi_val;

vec3 tone_map(vec3 color){
float l_in = color_luminance(color);
float l_out = (p * l_in) / (p * l_in - l_in + hi_val);
return color / l_in * l_out;
float l_out = (p * l_in) / (p * l_in + hi_val - l_in);
return (color / l_in) * l_out;
}

0 comments on commit 9e0be4b

Please sign in to comment.