This commit is contained in:
2026-06-25 23:52:25 +02:00
parent b593bd64bd
commit 5714d027b7
22 changed files with 260 additions and 12 deletions

BIN
assets/gradient_linear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b2y7oc421yoyd"
path="res://.godot/imported/gradient_linear.png-f1664a719d29c2fd7ef75dfe3ee8f4a4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/gradient_linear.png"
dest_files=["res://.godot/imported/gradient_linear.png-f1664a719d29c2fd7ef75dfe3ee8f4a4.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
assets/metaball.kra Normal file

Binary file not shown.

BIN
assets/metaball.kra~ Normal file

Binary file not shown.

BIN
assets/metaball.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://byk86jmfv7p64"
path.s3tc="res://.godot/imported/metaball.png-a6b8702ab5ec503295d5f109cf071bd1.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/metaball.png"
dest_files=["res://.godot/imported/metaball.png-a6b8702ab5ec503295d5f109cf071bd1.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

BIN
assets/metaball.png~ Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,37 @@
shader_type canvas_item;
varying vec2 quad_uv;
uniform vec2 ball_0;
uniform vec2 ball_1;
uniform vec2 ball_2;
uniform vec2 rect_size = vec2(1920, 1080);
uniform float ball_radius = 12.0;
uniform float cam_zoom = 1.0;
uniform vec2 cam_pos = vec2(0.0);
uniform float threshold : hint_range(0.0, 1.0) = 0.5;
uniform vec4 color : source_color = vec4(0.3, 0.5, 0.2, 1.0);
uniform sampler2D noise_tex : repeat_enable;
void vertex() {
quad_uv = UV;
}
float field(vec2 pos) {
return (ball_radius * cam_zoom) / max(length(quad_uv * rect_size - pos), 1.0);
}
void fragment() {
float sum = field(ball_0) + field(ball_1) + field(ball_2);
float a = smoothstep(threshold - 0.05, threshold, sum);
vec2 screen_px = quad_uv * rect_size;
vec2 world_px = (screen_px - rect_size * 0.5) / cam_zoom + cam_pos;
float n1 = texture(noise_tex, world_px * 0.0005).r;
float n2 = texture(noise_tex, world_px * 0.0008 + 0.33).r;
float hue_shift = (n1 - 0.5) * 0.12;
float value_shift = (n2 - 0.5) * 0.15;
vec3 shifted = color.rgb + vec3(hue_shift * 0.5, hue_shift, -hue_shift * 0.5) + value_shift;
COLOR = vec4(shifted, a * color.a);
}

View File

@@ -0,0 +1 @@
uid://8xu2s3gyxp0v