Added underpinnings for advanced screen flash; tweaked default values
for existing screen flash.
This commit is contained in:
parent
20b657c7b1
commit
8679e817ee
5 changed files with 23 additions and 7 deletions
15
shaders/flash_screen.gdshader
Normal file
15
shaders/flash_screen.gdshader
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform vec4 flash_color : source_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
uniform float intensity : hint_range(0.0, 1.0) = 0.0;
|
||||
uniform float edge_power : hint_range(0.1, 4.0) = 2.5;
|
||||
uniform float inner_ratio : hint_range(0.0, 1.0) = 0.75;
|
||||
uniform float feather : hint_range(0.01, 1.0) = 0.4;
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV * 2.0 - 1.0;
|
||||
float dist = length(uv);
|
||||
float a = smoothstep(inner_ratio, inner_ratio + feather, dist);
|
||||
a = pow(a, edge_power);
|
||||
COLOR = vec4(flash_color.rgb, a * flash_color.a * intensity);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue