added dropplet water, grenade, states, animation, YAYAY
This commit is contained in:
1 parent
f36db7cd2a
commit
5418f512cd
67 files changed
+1150
-52
No files matched your search
@@ -0,0 +1,22 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
// Use the captured screen texture from the BackBufferCopy
|
||||
uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
|
||||
|
||||
uniform float threshold : hint_range(0.0, 2.0) = 0.5;
|
||||
uniform float smoothness : hint_range(0.0, 1.0) = 0.02;
|
||||
uniform vec4 fluid_color : source_color = vec4(0.2, 0.5, 1.0, 1.0);
|
||||
|
||||
void fragment() {
|
||||
// 1. Grab the pixel from the 'screen' behind this ColorRect
|
||||
vec4 screen_color = texture(screen_texture, SCREEN_UV);
|
||||
|
||||
// 2. Read the brightness (density)
|
||||
float density = screen_color.r;
|
||||
|
||||
// 3. Apply the threshold/cutoff
|
||||
float alpha = smoothstep(threshold, threshold + smoothness, density);
|
||||
|
||||
// 4. Output the fluid
|
||||
COLOR = vec4(fluid_color.rgb, alpha * fluid_color.a);
|
||||
}
|
||||
Reference in new issue
Block a user