initial commit

This commit is contained in:
2020-08-25 21:57:31 +03:00
commit 3e29fd4373
166 changed files with 24675 additions and 0 deletions

25
shaders/ds_tonemap.glsl Normal file
View File

@@ -0,0 +1,25 @@
// vert //
void main(void) {
gl_Position = qgl_ftransform();
}
// frag //
uniform sampler2D tex_0;
uniform float gamma, frame_max;
const vec3 luma = vec3(0.299, 0.587, 0.114);
void main(void) {
ivec2 tc = ivec2(gl_FragCoord.xy);
vec4 src = texelFetch(tex_0, tc, 0);
vec3 res = src.rgb;
float l = dot(res, luma) * 0.75;
float g = gamma / frame_max;
res /= l;
l = 1 - exp(-l*g);
res *= l;
qgl_FragColor = vec4(res, dot(res, luma));
}