Add a weight for vignette.

This commit is contained in:
Vincent Lejeune 2014-06-28 00:20:44 +02:00
parent 21cb22f13a
commit 8f59d8cac0

View File

@ -4,6 +4,7 @@ uniform sampler2D tex;
uniform sampler2D logluminancetex;
uniform float exposure = .09;
uniform float Lwhite = 1.;
uniform float vignette_weight = 0.;
layout (std140) uniform MatrixesData
{
@ -43,12 +44,11 @@ void main()
// Uncharted2 tonemap with Auria's custom coefficients
vec4 perChannel = (col * (6.9 * col + .5)) / (col * (5.2 * col + 1.7) + 0.06);
perChannel = pow(perChannel, vec4(2.2));
vec2 inside = uv - 0.5;
float vignette = 1 - dot(inside, inside);
float vignette = 1. - dot(inside, inside) * vignette_weight;
vignette = clamp(pow(vignette, 0.8), 0., 1.);
//vignette = clamp(vignette + vignette - 0.5, 0., 1.15);
FragColor = vec4(perChannel.xyz * vignette, col.a);
}