Skip to content

Instantly share code, notes, and snippets.

@Flynsarmy
Flynsarmy / S_PopupRing.gdshader
Created September 20, 2025 14:10
Godot shader for a resizeable ring with segment highlight support. Make a Panel, add this as a ShaderMaterial.
shader_type canvas_item;
uniform vec4 color : source_color = vec4(1.);
uniform float thickness : hint_range(0.1, 1.) = .4;
uniform float ratio : hint_range(0., 1.) = .5;
uniform vec4 segment_color : source_color = vec4(1., .886, .412, 1.);
uniform int segment_count : hint_range(1, 12, 1) = 1;
uniform int segment_selected : hint_range(0, 12, 1) = 0;
// "Ring - exact" signed distance function - https://iquilezles.org/articles/distfunctions2d/