From 87ac0ca20d78c45507f03da78bce398e471e944f Mon Sep 17 00:00:00 2001 From: BrickPi Date: Wed, 13 Nov 2024 21:05:46 -0600 Subject: switch minimap background UI --- game/src/Game/GameSession/Menubar/Minimap.gdshader | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 game/src/Game/GameSession/Menubar/Minimap.gdshader (limited to 'game/src/Game/GameSession/Menubar/Minimap.gdshader') diff --git a/game/src/Game/GameSession/Menubar/Minimap.gdshader b/game/src/Game/GameSession/Menubar/Minimap.gdshader new file mode 100644 index 0000000..271b809 --- /dev/null +++ b/game/src/Game/GameSession/Menubar/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); +} -- cgit v1.2.3-56-ga3b1