niveau/transitions: shader de transition
Entre les niveaux et à la mort il y a maintenant un fondu au noir qui se met en place pour éviter d'avoir la gerbe sur les mouvements de caméra. la physique est en pause pendant la transition.
This commit is contained in:
16
shaders/transition_shader.gdshader
Normal file
16
shaders/transition_shader.gdshader
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user