aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Model/flag.gdshader
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-08 23:34:57 +0200
committer hop311 <hop3114@gmail.com>2024-07-10 22:44:01 +0200
commit1496de8262b104ad7dd52b9f6e936fcd6ed1d384 (patch)
tree8e82ee10733a1f41cbf44063cd12d9bdc9bc7f63 /game/src/Game/Model/flag.gdshader
parentd1ff26c46dbba3e373f5c71f7ed093b5cd9ca6a0 (diff)
Scrolling model materials (tank tracks and smoke)scrolling-textures
Diffstat (limited to 'game/src/Game/Model/flag.gdshader')
-rw-r--r--game/src/Game/Model/flag.gdshader9
1 files changed, 6 insertions, 3 deletions
diff --git a/game/src/Game/Model/flag.gdshader b/game/src/Game/Model/flag.gdshader
index d338e36..bf9ca18 100644
--- a/game/src/Game/Model/flag.gdshader
+++ b/game/src/Game/Model/flag.gdshader
@@ -9,7 +9,7 @@ uniform sampler2D texture_normal : hint_normal;
instance uniform uint flag_index;
-uniform vec2 scroll_speed = vec2(-0.25,0);
+const float normal_scroll_speed = 0.3;
// Scroll the Normal map, but leave the albedo alone
void fragment() {
@@ -21,6 +21,9 @@ void fragment() {
vec2 flag_uv = (vec2(flag_pos) + UV * vec2(flag_dims)) / vec2(flag_sheet_dims);
ALBEDO = texture(texture_flag_sheet_diffuse, flag_uv).rgb;
- //ALBEDO = vec3(1, 0, 0);
- NORMAL_MAP = texture(texture_normal, UV + TIME*scroll_speed).rgb;
+
+ vec2 normal_uv = UV;
+ normal_uv.x -= TIME * normal_scroll_speed;
+
+ NORMAL_MAP = texture(texture_normal, normal_uv).rgb;
}