From e2146bc5a1edda49d45354ac8ee78378f7093055 Mon Sep 17 00:00:00 2001 From: Marcin Kwapisz Date: Thu, 4 Feb 2021 01:56:17 +0100 Subject: [PATCH] Revert "Fix fragment shader" This reverts commit 98683e60f9f8b7a4b20c482af1bfb1a7d1711b36. --- shaders/shader_bloom.frag | 2 +- shaders/shader_tex.frag | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shaders/shader_bloom.frag b/shaders/shader_bloom.frag index dccb5a3..20be9af 100644 --- a/shaders/shader_bloom.frag +++ b/shaders/shader_bloom.frag @@ -8,7 +8,7 @@ uniform sampler2D bloomBlur; void main() { - const float gamma = 1.0; + const float gamma = 0.8; vec3 hdrColor = texture(scene, vTexCoords).rgb; vec3 bloomColor = texture(bloomBlur, vTexCoords).rgb; hdrColor += bloomColor; diff --git a/shaders/shader_tex.frag b/shaders/shader_tex.frag index 60f3dab..10105dc 100644 --- a/shaders/shader_tex.frag +++ b/shaders/shader_tex.frag @@ -26,7 +26,7 @@ void main() { vec3 fragColor = vec3(0,0,0); vec4 textureColor = texture2D(colorTexture, vTexCoord); - vec3 ambient = vec3(0.1, 0.1, 0.1) * textureColor.xyz; + vec4 ambient = vec4(0.1, 0.1, 0.1, 1.0) * textureColor; vec3 normal = normalize(interpNormal); for(int i = 0; i < NR_POINT_LIGHTS; i++) { @@ -45,9 +45,9 @@ void main() vec3 specular = spec * pointLights[i].color * (pointLights[i].intensity/dist); vec3 texture = vec3(textureColor.x, textureColor.y, textureColor.z); // * pointLights[i].color; - fragColor += texture*diffuse+vec3(1)*specular; + fragColor += mix(texture,texture*diffuse+vec3(1)*specular,0.9); } BrightColor = vec4(0.0, 0.0, 0.0, 1.0); - FragColor = vec4(fragColor+ambient,1.0); + FragColor = vec4(fragColor, 1.0) + ambient; }