31 lines
1.1 KiB
Text
31 lines
1.1 KiB
Text
shader_type spatial;
|
|
// Billboarded badge over carried or dropped loot: a center and a fill in the loot's category
|
|
// colors (crops: a sunflower; animals: pink; supplies: a sack) and a colored rim (red = carried
|
|
// off, yellow = dropped, pulsing toward white so it reads as "pick me up"). Drawn over the scene
|
|
// so a carrier behind a building can still be tracked.
|
|
render_mode unshaded, cull_disabled, depth_test_disabled, shadows_disabled;
|
|
|
|
uniform vec4 edge_color : source_color = vec4(1.0, 0.22, 0.15, 1.0);
|
|
uniform vec4 fill_color : source_color = vec4(1.0, 0.82, 0.18, 1.0);
|
|
uniform vec4 center_color : source_color = vec4(0.32, 0.18, 0.07, 1.0);
|
|
uniform float pulse : hint_range(0.0, 1.0) = 0.0;
|
|
|
|
void vertex() {
|
|
MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]);
|
|
}
|
|
|
|
void fragment() {
|
|
vec2 p = UV * 2.0 - 1.0;
|
|
float r = length(p);
|
|
if (r > 1.0) {
|
|
discard;
|
|
}
|
|
vec3 col = fill_color.rgb;
|
|
if (r < 0.34) {
|
|
col = center_color.rgb;
|
|
} else if (r > 0.74) {
|
|
col = mix(edge_color.rgb, vec3(1.0), pulse * 0.7);
|
|
}
|
|
ALBEDO = col;
|
|
ALPHA = 0.95;
|
|
}
|