diff --git a/data/shaders/alphatest_particle.vert b/data/shaders/alphatest_particle.vert index 4bb452938..899c21586 100644 --- a/data/shaders/alphatest_particle.vert +++ b/data/shaders/alphatest_particle.vert @@ -39,7 +39,7 @@ void main(void) vec4 particle_color = vec4(color_lifetime.zyx, 1.0); tc = Texcoord; -#if !defined(sRGB_Framebuffer_Usable) && !defined(Advanced_Lighting_Enabled) +#if !defined(Advanced_Lighting_Enabled) particle_color.rgb = pow(particle_color.rgb, vec3(1.0 / 2.2)); #endif pc = particle_color; diff --git a/data/shaders/simple_particle.vert b/data/shaders/simple_particle.vert index 7f971f7e9..3abc9bbda 100644 --- a/data/shaders/simple_particle.vert +++ b/data/shaders/simple_particle.vert @@ -44,7 +44,7 @@ void main(void) vec4 particle_color = vec4(color_lifetime.zyx, 1.0) * alpha; tc = Texcoord; -#if !defined(sRGB_Framebuffer_Usable) && !defined(Advanced_Lighting_Enabled) +#if !defined(Advanced_Lighting_Enabled) particle_color.rgb = pow(particle_color.rgb, vec3(1.0 / 2.2)); #endif pc = particle_color; diff --git a/data/shaders/sp_alpha_test.frag b/data/shaders/sp_alpha_test.frag index 488cbc322..a2aed868c 100644 --- a/data/shaders/sp_alpha_test.frag +++ b/data/shaders/sp_alpha_test.frag @@ -31,11 +31,7 @@ void main(void) vec3 final_color = col.xyz * color.xyz; #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4(final_color, 1.0); diff --git a/data/shaders/sp_decal.frag b/data/shaders/sp_decal.frag index b392e2836..cd3d0b4f5 100644 --- a/data/shaders/sp_decal.frag +++ b/data/shaders/sp_decal.frag @@ -17,11 +17,7 @@ void main(void) vec3 final_color = layer_two_tex.rgb + color.rgb * (1.0 - layer_two_tex.a); #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4(final_color, 1.0); diff --git a/data/shaders/sp_ghost.frag b/data/shaders/sp_ghost.frag index 982872dc6..22cafc2a9 100644 --- a/data/shaders/sp_ghost.frag +++ b/data/shaders/sp_ghost.frag @@ -30,11 +30,7 @@ void main() vec3 final_color = col.xyz * color.xyz; #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4((final_color * custom_alpha), custom_alpha); diff --git a/data/shaders/sp_grass.frag b/data/shaders/sp_grass.frag index 696f98820..37ff748c7 100644 --- a/data/shaders/sp_grass.frag +++ b/data/shaders/sp_grass.frag @@ -29,11 +29,7 @@ void main(void) vec3 final_color = col.xyz; #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4(final_color, 1.0); diff --git a/data/shaders/sp_normal_map.frag b/data/shaders/sp_normal_map.frag index 9420afea6..4a43a0765 100644 --- a/data/shaders/sp_normal_map.frag +++ b/data/shaders/sp_normal_map.frag @@ -23,7 +23,7 @@ void main() vec3 old_hsv = rgbToHsv(col.rgb); float mask_step = step(mask, 0.5); #if !defined(Advanced_Lighting_Enabled) - float saturation = mask * 2.1; + float saturation = mask * 1.825; // 2.5 * 0.5 ^ (1. / 2.2) #else float saturation = mask * 2.5; #endif @@ -35,11 +35,7 @@ void main() vec3 final_color = col.xyz * color.xyz; #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4(final_color, 1.0); diff --git a/data/shaders/sp_solid.frag b/data/shaders/sp_solid.frag index 826809943..6c5ab8e0a 100644 --- a/data/shaders/sp_solid.frag +++ b/data/shaders/sp_solid.frag @@ -21,7 +21,7 @@ void main(void) vec3 old_hsv = rgbToHsv(col.rgb); float mask_step = step(mask, 0.5); #if !defined(Advanced_Lighting_Enabled) - float saturation = mask * 2.1; + float saturation = mask * 1.825; // 2.5 * 0.5 ^ (1. / 2.2) #else float saturation = mask * 2.5; #endif @@ -33,11 +33,7 @@ void main(void) vec3 final_color = col.xyz * color.xyz; #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4(final_color, 1.0); diff --git a/data/shaders/sp_unlit.frag b/data/shaders/sp_unlit.frag index 54c2469d4..b7970ff8c 100644 --- a/data/shaders/sp_unlit.frag +++ b/data/shaders/sp_unlit.frag @@ -19,11 +19,7 @@ void main(void) vec3 final_color = col.xyz * color.xyz; #if !defined(Advanced_Lighting_Enabled) -#if !defined(sRGB_Framebuffer_Usable) final_color = final_color * 0.73; // 0.5 ^ (1. / 2.2) -#else - final_color = final_color * 0.5; -#endif #endif o_diffuse_color = vec4(final_color, 1.0); diff --git a/data/shaders/tonemap.frag b/data/shaders/tonemap.frag index cc6ccb48e..bad33244a 100644 --- a/data/shaders/tonemap.frag +++ b/data/shaders/tonemap.frag @@ -13,10 +13,6 @@ void main() // Uncharted2 tonemap with Auria's custom coefficients vec4 perChannel = (col * (6.9 * col + .5)) / (col * (5.2 * col + 1.7) + 0.06); -#if !(!defined(sRGB_Framebuffer_Usable) && defined(Advanced_Lighting_Enabled)) - perChannel = pow(perChannel, vec4(2.2)); -#endif - vec2 inside = uv - 0.5; float vignette = 1. - dot(inside, inside) * vignette_weight; vignette = clamp(pow(vignette, 0.8), 0., 1.); diff --git a/src/graphics/shader_based_renderer.cpp b/src/graphics/shader_based_renderer.cpp index bf3a3dd29..d64bed82c 100644 --- a/src/graphics/shader_based_renderer.cpp +++ b/src/graphics/shader_based_renderer.cpp @@ -886,15 +886,15 @@ void ShaderBasedRenderer::renderToTexture(GL3RenderTarget *render_target, if (CVS->isDefferedEnabled()) { renderSceneDeferred(camera, dt, false, true); + render_target->setFrameBuffer(m_post_processing + ->render(camera, false, m_rtts)); } else { renderScene(camera, dt, false, true); + render_target->setFrameBuffer(&m_rtts->getFBO(FBO_COLORS)); } - render_target->setFrameBuffer(m_post_processing - ->render(camera, false, m_rtts)); - // reset glViewport(0, 0, irr_driver->getActualScreenSize().Width,