Don't allow certain shaders twice
This commit is contained in:
parent
d290d00b12
commit
fbbc93ab2c
3 changed files with 11 additions and 8 deletions
|
@ -30,12 +30,12 @@ void vertex() {
|
||||||
|
|
||||||
void fragment() {
|
void fragment() {
|
||||||
vec2 chaos_v = vec2(chaos, -chaos) * SCREEN_PIXEL_SIZE;
|
vec2 chaos_v = vec2(chaos, -chaos) * SCREEN_PIXEL_SIZE;
|
||||||
|
|
||||||
float dist = length((UV - vec2(0.5)) * 2.);
|
float dist = length((UV - vec2(0.5)) * 2.);
|
||||||
float att = clamp(dist / radius, 0., 1.);
|
float att = clamp(dist / radius, 0., 1.);
|
||||||
|
|
||||||
chaos_v *= 1. - pow(att, attenuation);
|
chaos_v *= 1. - pow(att, attenuation);
|
||||||
|
|
||||||
COLOR = vec4(
|
COLOR = vec4(
|
||||||
texture(TEXTURE, SCREEN_UV + chaos_v * amount_r).r,
|
texture(TEXTURE, SCREEN_UV + chaos_v * amount_r).r,
|
||||||
texture(TEXTURE, SCREEN_UV + chaos_v * amount_g).g,
|
texture(TEXTURE, SCREEN_UV + chaos_v * amount_g).g,
|
||||||
|
|
|
@ -9,16 +9,16 @@ uniform float sort :hint_range(0.0, 2.6)= .5;
|
||||||
|
|
||||||
void fragment(){
|
void fragment(){
|
||||||
vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy;
|
vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy;
|
||||||
|
|
||||||
// Pseudo Pixel Sorting
|
// Pseudo Pixel Sorting
|
||||||
float sortThreshold = 1.0 - clamp(sort / 2.6, 0.0, 1.0);
|
float sortThreshold = 1.0 - clamp(sort / 2.6, 0.0, 1.0);
|
||||||
vec2 sortUv = vec2(uv.x, sortThreshold);
|
vec2 sortUv = vec2(uv.x, sortThreshold);
|
||||||
|
|
||||||
// Curved melting transition
|
// Curved melting transition
|
||||||
vec2 transitionUV = uv;
|
vec2 transitionUV = uv;
|
||||||
transitionUV.y += pow(sort, 2.0 + (sort * 2.0)) * uv.x * fract(sin(dot(vec2(transitionUV.x), vec2(12.9, 78.2)))* 437.5);
|
transitionUV.y += pow(sort, 2.0 + (sort * 2.0)) * uv.x * fract(sin(dot(vec2(transitionUV.x), vec2(12.9, 78.2)))* 437.5);
|
||||||
COLOR = texture(TEXTURE, transitionUV);
|
COLOR = texture(TEXTURE, transitionUV);
|
||||||
|
|
||||||
// Draw pixel sorting effect behind the melting transition
|
// Draw pixel sorting effect behind the melting transition
|
||||||
if(transitionUV.y > 1.){
|
if(transitionUV.y > 1.){
|
||||||
COLOR = texture(TEXTURE, sortUv);
|
COLOR = texture(TEXTURE, sortUv);
|
||||||
|
|
|
@ -35,9 +35,9 @@ func _ready() -> void:
|
||||||
|
|
||||||
var shader_name: String = \"\".join(shader.get_meta(\"shader_name\"));
|
var shader_name: String = \"\".join(shader.get_meta(\"shader_name\"));
|
||||||
|
|
||||||
print(shader.get_meta(\"shader_name\"))
|
|
||||||
match shader_name:
|
match shader_name:
|
||||||
\"pixelate\":
|
\"pixelate\":
|
||||||
|
shaders.remove_at(shaders.find(shader, 0));
|
||||||
print(\"pixelate\")
|
print(\"pixelate\")
|
||||||
material.set_shader_parameter(\"x_pixel_size\", randi_range(1, 5));
|
material.set_shader_parameter(\"x_pixel_size\", randi_range(1, 5));
|
||||||
material.set_shader_parameter(\"y_pixel_size\", randi_range(1, 5));
|
material.set_shader_parameter(\"y_pixel_size\", randi_range(1, 5));
|
||||||
|
@ -49,10 +49,12 @@ func _ready() -> void:
|
||||||
material.set_shader_parameter(\"attenuation\", randf_range(2.0, 5.0));
|
material.set_shader_parameter(\"attenuation\", randf_range(2.0, 5.0));
|
||||||
|
|
||||||
\"kaleidoscope\":
|
\"kaleidoscope\":
|
||||||
|
shaders.remove_at(shaders.find(shader, 0));
|
||||||
print(\"kaleidoscope\")
|
print(\"kaleidoscope\")
|
||||||
material.set_shader_parameter(\"segments\", float(randi_range(5.0, 8.0)));
|
material.set_shader_parameter(\"segments\", float(randi_range(3.0, 5.0)));
|
||||||
|
|
||||||
\"pixelsort\":
|
\"pixelsort\":
|
||||||
|
shaders.remove_at(shaders.find(shader, 0));
|
||||||
print(\"pixelsort\")
|
print(\"pixelsort\")
|
||||||
material.set_shader_parameter(\"sort\", randf_range(0.1, 2.6));
|
material.set_shader_parameter(\"sort\", randf_range(0.1, 2.6));
|
||||||
|
|
||||||
|
@ -286,6 +288,7 @@ stretch_mode = 6
|
||||||
[node name="AutoScale" parent="KaleidoViewport" instance=ExtResource("2_7v8f2")]
|
[node name="AutoScale" parent="KaleidoViewport" instance=ExtResource("2_7v8f2")]
|
||||||
|
|
||||||
[node name="TextMask" type="TextureRect" parent="."]
|
[node name="TextMask" type="TextureRect" parent="."]
|
||||||
|
visible = false
|
||||||
material = SubResource("ShaderMaterial_ahqjw")
|
material = SubResource("ShaderMaterial_ahqjw")
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
|
|
Loading…
Reference in a new issue