Sun, Shovel, Fastforward, GUI Improvements
This commit is contained in:
parent
26c3aeb7e9
commit
63935d5978
28 changed files with 546 additions and 45 deletions
23
assets/shaders/shared_outline.gdshader
Normal file
23
assets/shaders/shared_outline.gdshader
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform vec3 line_colour: source_color = vec3(1.0);
|
||||
uniform int line_thickness: hint_range(0, 50) = 1;
|
||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
vec2 size = SCREEN_PIXEL_SIZE * float(line_thickness);
|
||||
float line_alpha = 0.0;
|
||||
for (float i = -size.x; i <= size.x; i += SCREEN_PIXEL_SIZE.x) {
|
||||
for (float j = -size.y; j <= size.y; j += SCREEN_PIXEL_SIZE.y) {
|
||||
line_alpha += texture(screen_texture, SCREEN_UV + vec2(i, j)).a;
|
||||
}
|
||||
}
|
||||
vec4 colour = textureLod(screen_texture, SCREEN_UV,0.0);
|
||||
|
||||
if (colour.a > 0.0001) {
|
||||
colour.rgb /= colour.a;
|
||||
}
|
||||
|
||||
vec4 outline = vec4(line_colour, min(line_alpha, 1.0));
|
||||
COLOR *= mix(outline, colour, colour.a);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue