Un shader de transition entre les scènes

ça fait plus propre braw
This commit is contained in:
Thomas
2025-04-14 17:24:10 +02:00
parent bf2ed6312d
commit 5e32ed4196
13 changed files with 228 additions and 18 deletions

View File

@@ -0,0 +1,16 @@
shader_type canvas_item;
render_mode unshaded;
uniform float cutoff: hint_range(0.0, 1.0);
uniform float smooth_size: hint_range(0.0, 0.1);
uniform sampler2D mask: hint_default_black;
void fragment() {
float value = texture(mask, UV).r;
float alpha = smoothstep(
cutoff,
cutoff + smooth_size,
value * (1.0 - smooth_size) + smooth_size
);
COLOR = vec4(COLOR.rgb, alpha);
}