From 6b8f544bd86e3a642a72413cc252364054c7e5d6 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Wed, 6 Nov 2013 22:48:09 +0100
Subject: [PATCH] better differenciate runicshields

---
 game/modules/tome/data/gfx/shaders/runicshield.frag | 5 +++--
 game/modules/tome/data/gfx/shaders/runicshield.lua  | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/data/gfx/shaders/runicshield.frag b/game/modules/tome/data/gfx/shaders/runicshield.frag
index f9f688f108..43711a0a56 100644
--- a/game/modules/tome/data/gfx/shaders/runicshield.frag
+++ b/game/modules/tome/data/gfx/shaders/runicshield.frag
@@ -1,5 +1,6 @@
 uniform sampler2D tex;
 uniform float tick;
+uniform float tick_start;
 uniform float aadjust;
 uniform vec4 bubbleColor;
 uniform vec4 auraColor;
@@ -230,7 +231,7 @@ void main(void)
 
 		vec2 sphericalProjectedCoord = vec2(0.5, 0.5) + radius * (alpha / (3.141592 / 2.0)) / radiusLen;
 
-		shieldColorSample = texture2D(tex, (sphericalProjectedCoord * 0.3 + vec2(scrollingSpeed * tick / time_factor, 0.0)));
+		shieldColorSample = texture2D(tex, (sphericalProjectedCoord * 0.3 + vec2(scrollingSpeed * (tick - tick_start) / time_factor, 0.0)));
 		shieldColorSample.a = 1.0 - exp(-shieldColorSample.a * shieldIntensity / cos(alpha));
 		//impact adjusts resulting transperency
 		shieldColorSample.a *= aadjust;
@@ -241,7 +242,7 @@ void main(void)
 	vec4 auraColorSample = vec4(0.0, 0.0, 0.0, 0.0);
 	if(length(radius) > innerRadius && length(radius) < outerRadius)
 	{
-		auraColorSample = GetFireRingColor(tick / time_factor, radius, 5.0, 50.0, 1.0, 2.0, innerRadius, outerRadius, 0.1, 0.25) * auraColor;
+		auraColorSample = GetFireRingColor((tick - tick_start) / time_factor, radius, 5.0, 50.0, 1.0, 2.0, innerRadius, outerRadius, 0.1, 0.25) * auraColor;
 	}
 
 	float ratio = (radiusLen - innerRadius) / (shieldRadius - innerRadius);
diff --git a/game/modules/tome/data/gfx/shaders/runicshield.lua b/game/modules/tome/data/gfx/shaders/runicshield.lua
index 57ccebea66..94d2f76b76 100644
--- a/game/modules/tome/data/gfx/shaders/runicshield.lua
+++ b/game/modules/tome/data/gfx/shaders/runicshield.lua
@@ -40,5 +40,8 @@ return {
 		scrollingSpeed = scrollingSpeed or 1.0,
 		auraWidth = auraWidth or 0.1,
 	},
+	resetargs = {
+		tick_start = function() return core.game.getFrameTime() end,
+	},
 	clone = false,
 }
-- 
GitLab