chore,gd: refactored project structure and started the mantle system
This commit is contained in:
24
player_controller/Shaders/Blur.gdshader
Normal file
24
player_controller/Shaders/Blur.gdshader
Normal file
@ -0,0 +1,24 @@
|
||||
// Original by ChaffDave : https://godotshaders.com/shader/tilt-shift-shader/
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform float limit: hint_range(0.0,0.5) = 0.2;
|
||||
uniform float blur: hint_range(0.0,8.0) = 2.0;
|
||||
uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
|
||||
|
||||
void fragment(){
|
||||
|
||||
if (UV.y<limit){
|
||||
|
||||
float blur_amount = blur * (1.0 - (SCREEN_UV.y / limit));
|
||||
COLOR = textureLod(screen_texture, SCREEN_UV, blur_amount);
|
||||
|
||||
} else if (UV.y > 1.0-limit){
|
||||
|
||||
float blur_amount = blur * (1.0 - ((1.0 - SCREEN_UV.y) / limit));
|
||||
COLOR = textureLod(screen_texture, SCREEN_UV, blur_amount);
|
||||
|
||||
} else {
|
||||
COLOR.a = 0.0;
|
||||
}
|
||||
}
|
1
player_controller/Shaders/Blur.gdshader.uid
Normal file
1
player_controller/Shaders/Blur.gdshader.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://btw6vsb6sa7sn
|
45
player_controller/Shaders/Distortion.gdshader
Normal file
45
player_controller/Shaders/Distortion.gdshader
Normal file
@ -0,0 +1,45 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
|
||||
uniform float screen_darkness = 0.0;
|
||||
uniform float darkness_progression = 0.0;
|
||||
|
||||
uniform sampler2D smoke;
|
||||
uniform float size: hint_range(0.0, 1.0);
|
||||
|
||||
uniform vec2 uv_offset;
|
||||
|
||||
vec4 lerp(vec4 a, vec4 b, float t){
|
||||
vec4 val = vec4(
|
||||
(b.x * t) + a.x * (1.0 - t),
|
||||
(b.y * t) + a.y * (1.0 - t),
|
||||
(b.z * t) + a.z * (1.0 - t),
|
||||
(b.w * t) + a.w * (1.0 - t));
|
||||
|
||||
return clamp(val, 0, 1);
|
||||
}
|
||||
|
||||
// Function to remap a value from one range to another
|
||||
float remap(float value, float old_min, float old_max, float new_min, float new_max) {
|
||||
return new_min + (value - old_min) * (new_max - new_min) / (old_max - old_min);
|
||||
}
|
||||
|
||||
void fragment(){
|
||||
vec2 smoke_uv = UV;
|
||||
smoke_uv += uv_offset;
|
||||
|
||||
vec4 smoke_color = texture(smoke, fract(smoke_uv));
|
||||
|
||||
float size_remapped = remap(size, 0.0, 1.0, 0.0, 0.008);
|
||||
|
||||
smoke_color = clamp(smoke_color * size_remapped, 0.0, 1.0);
|
||||
|
||||
vec4 img_color = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(smoke_color.g - size_remapped/2.0,0.0));
|
||||
|
||||
float screen_darkness_inverted = 1.0 - screen_darkness;
|
||||
|
||||
float darkness_scalar = (img_color.x + img_color.y + img_color.z) / 3.0 * screen_darkness_inverted;
|
||||
vec4 darkness_color = vec4(darkness_scalar, darkness_scalar, darkness_scalar, 1.0);
|
||||
|
||||
COLOR = lerp(img_color, darkness_color, darkness_progression);
|
||||
}
|
1
player_controller/Shaders/Distortion.gdshader.uid
Normal file
1
player_controller/Shaders/Distortion.gdshader.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b11c2xtiflut5
|
10
player_controller/Shaders/Vignette.gdshader
Normal file
10
player_controller/Shaders/Vignette.gdshader
Normal file
@ -0,0 +1,10 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform vec4 color : source_color;
|
||||
uniform float multiplier = 0.2;
|
||||
uniform float softness = 3.0;
|
||||
|
||||
void fragment() {
|
||||
float distance_to_center = distance(UV, vec2(0.5));
|
||||
COLOR = vec4(color.rgb, smoothstep(multiplier, softness, distance_to_center));
|
||||
}
|
1
player_controller/Shaders/Vignette.gdshader.uid
Normal file
1
player_controller/Shaders/Vignette.gdshader.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://vf7jayskpmj4
|
Reference in New Issue
Block a user