Gamma correction

This commit is contained in:
Mev Lyshkin 2021-05-05 15:44:27 +02:00
parent ff87ee4204
commit de94391295
3 changed files with 409 additions and 374 deletions

774
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ void main()
vec2 coord = vec2(dx*floor(TexCoords.x/dx), dy*floor(TexCoords.y/dy));
vec3 tc = texture(screenTexture, coord).rgb;
FragColor = vec4(tc,1.0) * vig;
float gamma = 2.2;
FragColor = vec4(pow(tc, vec3(1.0/gamma)),1.0) * vig;
}

View File

@ -73,7 +73,7 @@ impl Default for PointLight {
fn default() -> Self {
PointLight {
pos: vec3(0.0, 0.0, 0.0),
ambient: vec3(0.05, 0.05, 0.05),
ambient: vec3(0.00, 0.00, 0.00),
diffuse: vec3(0.8, 0.8, 0.8),
specular: vec3(1.0, 1.0, 1.0),
constant: 1.0,
@ -100,7 +100,7 @@ impl Default for DirectionalLight {
fn default() -> Self {
DirectionalLight {
direction: vec3(-0.3, -1.0, -0.3),
ambient: vec3(0.14, 0.14, 0.14),
ambient: vec3(0.05, 0.05, 0.05),
diffuse: vec3(0.4, 0.4, 0.4),
specular: vec3(0.5, 0.5, 0.5),
}