aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Model/flag.gdshader
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-11 20:33:49 +0200
committer GitHub <noreply@github.com>2024-07-11 20:33:49 +0200
commit114394f4d1bcf5249089b6e3632d259a195ec584 (patch)
tree8e82ee10733a1f41cbf44063cd12d9bdc9bc7f63 /game/src/Game/Model/flag.gdshader
parentd1ff26c46dbba3e373f5c71f7ed093b5cd9ca6a0 (diff)
parent1496de8262b104ad7dd52b9f6e936fcd6ed1d384 (diff)
Merge pull request #237 from OpenVicProject/scrolling-textures
Scrolling model materials (tank tracks and smoke)
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;
}