aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/MapControlPanel/Minimap.gdshader
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-06-04 02:17:28 +0200
committer GitHub <noreply@github.com>2023-06-04 02:17:28 +0200
commit3236f51d700674aee6ee6572109ffb3d5fa5fed2 (patch)
treeb898150a8a45e7c0d814459e7f12f39429acefeb /game/src/Game/GameSession/MapControlPanel/Minimap.gdshader
parent73e29d02e48739aba5ca5db1b9575c67e795400f (diff)
parentb98166b28c47cccff731d30959b8250fb27ff408 (diff)
Merge pull request #130 from Spartan322/organize/godot-project
Diffstat (limited to 'game/src/Game/GameSession/MapControlPanel/Minimap.gdshader')
-rw-r--r--game/src/Game/GameSession/MapControlPanel/Minimap.gdshader18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/src/Game/GameSession/MapControlPanel/Minimap.gdshader b/game/src/Game/GameSession/MapControlPanel/Minimap.gdshader
new file mode 100644
index 0000000..271b809
--- /dev/null
+++ b/game/src/Game/GameSession/MapControlPanel/Minimap.gdshader
@@ -0,0 +1,18 @@
+shader_type canvas_item;
+
+#include "res://src/Game/GameSession/ProvinceIndexSampler.gdshaderinc"
+
+// Index of the currently selected province
+uniform uint selected_index;
+
+const vec3 land_colour = vec3(0.5);
+const vec3 selected_colour = vec3(1.0, 1.0, 0.0);
+
+void fragment() {
+ uvec3 data = read_uvec3(UV);
+ uint index = uvec2_to_uint(data.rg);
+ float is_land = float(data.b != 0u);
+ float is_selected = float(index == selected_index);
+ COLOR.rgb = mix(COLOR.rgb, land_colour, is_land);
+ COLOR.rgb = mix(COLOR.rgb, selected_colour, is_selected);
+}