Restructuring the project directory

This commit is contained in:
2021-01-16 19:57:22 +01:00
parent 938450ce75
commit 7e9702431f
31 changed files with 68 additions and 53 deletions

View File

@@ -0,0 +1,27 @@
#version 330 core
const float GAMMA = 2.2f;
layout(location = 0) out vec4 f_color;
in vec2 v_tex_coords;
uniform float u_exposure;
uniform bool u_exposureCorrection;
uniform sampler2D u_texture;
void main() {
vec3 fragmentColor = vec3(texture2D(u_texture, v_tex_coords));
// Exposure tone mapping
if(u_exposureCorrection)
fragmentColor = vec3(1.0) - exp(-fragmentColor * u_exposure);
// Gamma correction
fragmentColor = pow(fragmentColor, vec3(1.0/GAMMA));
f_color = vec4(fragmentColor, 1.0f);
}