aboutsummaryrefslogtreecommitdiff
path: root/game/src/GameSession/MapControlPanel/Minimap.gdshader
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-05-12 02:21:09 +0200
committer GitHub <noreply@github.com>2023-05-12 02:21:09 +0200
commit398ba6f05ae1bb13e59790436bf0da299e5a399d (patch)
tree68cfc1f01f6a13067417e53d1ed8547cffbb969c /game/src/GameSession/MapControlPanel/Minimap.gdshader
parentc784a95478ec369fe9255622d40ac498b7a23079 (diff)
parent9ed9ee209ef9accebb9ec0d81ec58b569d680b6a (diff)
Merge pull request #111 from OpenVic2Project/goods
Added Goods loading + mapmode
Diffstat (limited to 'game/src/GameSession/MapControlPanel/Minimap.gdshader')
-rw-r--r--game/src/GameSession/MapControlPanel/Minimap.gdshader18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/src/GameSession/MapControlPanel/Minimap.gdshader b/game/src/GameSession/MapControlPanel/Minimap.gdshader
new file mode 100644
index 0000000..608abe2
--- /dev/null
+++ b/game/src/GameSession/MapControlPanel/Minimap.gdshader
@@ -0,0 +1,18 @@
+shader_type canvas_item;
+
+#include "res://src/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);
+}