many small changes, and few big ones
This commit is contained in:
parent
e8985f4e79
commit
a3ca623258
32 changed files with 391 additions and 247 deletions
|
@ -8,8 +8,7 @@ uniform sampler2D vignette_mask;
|
|||
|
||||
// constants
|
||||
|
||||
const float rgb_distortion_v_mult = 0.9;
|
||||
const float rgb_distortion_v_exp = 2.0;
|
||||
const float rgb_distortion_v_mult = 0.5;
|
||||
const float rgb_distortion_v_min = 0.04;
|
||||
const float rgb_distortion_v_max = 0.12;
|
||||
|
||||
|
@ -19,13 +18,13 @@ void fragment() {
|
|||
float v = texture(vignette_mask, SCREEN_UV).r;
|
||||
// rgb & blur distortion
|
||||
float v_ = clamp(
|
||||
pow(v * rgb_distortion_v_mult, rgb_distortion_v_exp),
|
||||
v * rgb_distortion_v_mult,
|
||||
rgb_distortion_v_min,
|
||||
rgb_distortion_v_max
|
||||
);
|
||||
vec2 screen_uv_r = SCREEN_UV - (v_ * 0.01);
|
||||
vec2 screen_uv_g = SCREEN_UV + (v_ * 0.01);
|
||||
vec2 screen_uv_b = SCREEN_UV;
|
||||
vec2 screen_uv_r = SCREEN_UV + vec2(-v_ * 0.01, 0.0);
|
||||
vec2 screen_uv_g = SCREEN_UV + vec2(0.0, v_ * 0.01);
|
||||
vec2 screen_uv_b = SCREEN_UV + vec2(v_ * 0.01, -v_ * 0.01);
|
||||
COLOR.r = textureLod(screen_texture, screen_uv_r, v).r;
|
||||
COLOR.g = textureLod(screen_texture, screen_uv_g, v).g;
|
||||
COLOR.b = textureLod(screen_texture, screen_uv_b, v).b;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
[gd_resource type="GradientTexture2D" load_steps=2 format=3 uid="uid://bwlgypt4xjocj"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_h26vj"]
|
||||
interpolation_mode = 2
|
||||
offsets = PackedFloat32Array(0.0432099, 1)
|
||||
colors = PackedColorArray(0.0768358, 0.0768358, 0.0768358, 1, 1, 1, 1, 1)
|
||||
|
||||
[resource]
|
||||
gradient = SubResource("Gradient_h26vj")
|
||||
|
|
Reference in a new issue