git-svn-id: svn://db.shs.com.ru/libs@671 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-10 18:01:17 +00:00
parent ff4f9a3b2b
commit 16146ae6fd
4 changed files with 20 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ void main(void) {
// frag //
uniform sampler2D tex_0;
uniform float exposure, frame_max;
uniform float gamma, frame_max;
const vec3 luma = vec3(0.299, 0.587, 0.114);
@@ -17,7 +17,7 @@ void main(void) {
vec4 src = texelFetch(tex_0, tc, 0);
vec3 res = src.rgb;
float l = dot(res, luma) * 0.75;
float g = exposure / frame_max;
float g = gamma / frame_max;
res /= l;
l = 1 - exp(-l*g);
qgl_FragColor.rgb = res * l;