Index: ps/trunk/binaries/data/mods/public/shaders/arb/model_common.fp =================================================================== --- ps/trunk/binaries/data/mods/public/shaders/arb/model_common.fp +++ ps/trunk/binaries/data/mods/public/shaders/arb/model_common.fp @@ -149,6 +149,8 @@ #if !IGNORE_LOS // Multiply everything by the LOS texture TEX tex.r, v_los, texture[2], 2D; + SUB tex.r, tex.r, 0.03; + MUL tex.r, tex.r, 0.97; MUL color.rgb, color, tex.r; #endif Index: ps/trunk/binaries/data/mods/public/shaders/arb/overlayline.fp =================================================================== --- ps/trunk/binaries/data/mods/public/shaders/arb/overlayline.fp +++ ps/trunk/binaries/data/mods/public/shaders/arb/overlayline.fp @@ -19,6 +19,8 @@ // Multiply RGB by LOS texture (red channel) TEMP los; TEX los, fragment.texcoord[1], texture[2], 2D; + SUB los.r, los.r, 0.03; + MUL los.r, los.r, 0.97; MUL result.color.rgb, color, los.r; #endif Index: ps/trunk/binaries/data/mods/public/shaders/arb/particle.fp =================================================================== --- ps/trunk/binaries/data/mods/public/shaders/arb/particle.fp +++ ps/trunk/binaries/data/mods/public/shaders/arb/particle.fp @@ -17,6 +17,8 @@ // Multiply everything by the LOS texture TEX losTex, v_los, texture[1], 2D; +SUB losTex.r, losTex.r, 0.03; +MUL losTex.r, losTex.r, 0.97; MUL result.color.rgb, color, losTex.r; MUL result.color.a, tex, fragment.color; Index: ps/trunk/binaries/data/mods/public/shaders/arb/terrain_common.fp =================================================================== --- ps/trunk/binaries/data/mods/public/shaders/arb/terrain_common.fp +++ ps/trunk/binaries/data/mods/public/shaders/arb/terrain_common.fp @@ -88,6 +88,8 @@ // Multiply everything by the LOS texture TEX tex.r, fragment.texcoord[3], texture[3], 2D; +SUB tex.r, tex.r, 0.03; +MUL tex.r, tex.r, 0.97; MUL color.rgb, color, tex.r; #if DECAL Index: ps/trunk/binaries/data/mods/public/shaders/arb/water_simple.fp =================================================================== --- ps/trunk/binaries/data/mods/public/shaders/arb/water_simple.fp +++ ps/trunk/binaries/data/mods/public/shaders/arb/water_simple.fp @@ -11,6 +11,8 @@ TEMP los; TEX los, v_losCoords, texture[1], 2D; +SUB los.r, los.r, 0.03; +MUL los.r, los.r, 0.97; MUL diffuse, diffuse, los.r; MOV result.color, diffuse; Index: ps/trunk/source/graphics/LOSTexture.h =================================================================== --- ps/trunk/source/graphics/LOSTexture.h +++ ps/trunk/source/graphics/LOSTexture.h @@ -98,6 +98,7 @@ m_Texture, m_SmoothTextures[2]; uint32_t m_WhichTexture = 0; + double m_LastTextureRecomputeTime = 0.0; // We update textures once a frame, so we change a Framebuffer once a frame. // That allows us to use two ping-pong FBOs instead of checking completeness Index: ps/trunk/source/graphics/LOSTexture.cpp =================================================================== --- ps/trunk/source/graphics/LOSTexture.cpp +++ ps/trunk/source/graphics/LOSTexture.cpp @@ -22,6 +22,8 @@ #include "graphics/ShaderManager.h" #include "lib/bits.h" #include "lib/config2.h" +#include "lib/timer.h" +#include "maths/MathUtil.h" #include "ps/CLogger.h" #include "ps/CStrInternStatic.h" #include "ps/Game.h" @@ -132,6 +134,8 @@ if (m_Dirty) { RecomputeTexture(deviceCommandContext); + m_LastTextureRecomputeTime = timer_Time(); + m_WhichTexture = 1u - m_WhichTexture; m_Dirty = false; } @@ -150,11 +154,11 @@ deviceCommandContext->SetTexture( shader->GetBindingSlot(str_losTex1), m_Texture.get()); deviceCommandContext->SetTexture( - shader->GetBindingSlot(str_losTex2), m_SmoothTextures[m_WhichTexture].get()); + shader->GetBindingSlot(str_losTex2), m_SmoothTextures[1u - m_WhichTexture].get()); - deviceCommandContext->SetUniform( - shader->GetBindingSlot(str_delta), - static_cast(g_Renderer.GetTimeManager().GetFrameDelta() * 4.0f)); + const float delta = Clamp( + (timer_Time() - m_LastTextureRecomputeTime) * 2.0f, 0.0f, 1.0f); + deviceCommandContext->SetUniform(shader->GetBindingSlot(str_delta), delta); const SViewPort oldVp = g_Renderer.GetViewport(); const SViewPort vp = @@ -208,8 +212,6 @@ deviceCommandContext->SetFramebuffer( deviceCommandContext->GetDevice()->GetCurrentBackbuffer()); - - m_WhichTexture = 1u - m_WhichTexture; }