Skip to content
Snippets Groups Projects
Commit fa75f2c2 authored by DarkGod's avatar DarkGod
Browse files

shield shader uses tickstart too

parent 4337002d
No related branches found
No related tags found
No related merge requests found
uniform sampler2D tex;
uniform float tick;
uniform float tick_start;
uniform float aadjust;
uniform vec3 color;
uniform float time_factor;
......@@ -68,8 +69,8 @@ void main(void)
vec2 sphericalProjectedCoord = vec2(0.5, 0.5) + radius * (alpha / (3.141592 / 2.0)) / radiusLen;
//two scrolling textures
vec4 c1 = texture2D(tex, (sphericalProjectedCoord + vec2(horizontalScrollingSpeed * tick / time_factor, 0.0)));
vec4 c2 = texture2D(tex, (sphericalProjectedCoord + vec2(0.0, verticalScrollingSpeed * tick / time_factor)));
vec4 c1 = texture2D(tex, (sphericalProjectedCoord + vec2(horizontalScrollingSpeed * (tick - tick_start) / time_factor, 0.0)));
vec4 c2 = texture2D(tex, (sphericalProjectedCoord + vec2(0.0, verticalScrollingSpeed * (tick - tick_start) / time_factor)));
vec4 c = c1 * c2;
//exponential thin layer absorbtion under angle alpha
......
......@@ -40,5 +40,8 @@ return {
horizontalScrollingSpeed = horizontalScrollingSpeed or 1.0,
verticalScrollingSpeed = verticalScrollingSpeed or 0.3,
},
resetargs = {
tick_start = function() return core.game.getFrameTime() end,
},
clone = false,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment