From 96d1a4f4dd5ab345e1144565b5cf68ac206e8182 Mon Sep 17 00:00:00 2001 From: Zacharie Guet Date: Fri, 6 Feb 2026 10:29:32 +0100 Subject: [PATCH] nettoyage de repo --- common/vfx/materials/shaders/outline.gdshader | 56 ------------------- .../materials/shaders/outline.gdshader.uid | 1 - .../materials/shaders/pixelisation.gdshader | 19 ------- .../shaders/pixelisation.gdshader.uid | 1 - 4 files changed, 77 deletions(-) delete mode 100644 common/vfx/materials/shaders/outline.gdshader delete mode 100644 common/vfx/materials/shaders/outline.gdshader.uid delete mode 100644 common/vfx/materials/shaders/pixelisation.gdshader delete mode 100644 common/vfx/materials/shaders/pixelisation.gdshader.uid diff --git a/common/vfx/materials/shaders/outline.gdshader b/common/vfx/materials/shaders/outline.gdshader deleted file mode 100644 index 056df41..0000000 --- a/common/vfx/materials/shaders/outline.gdshader +++ /dev/null @@ -1,56 +0,0 @@ -shader_type spatial; -render_mode blend_premul_alpha, unshaded, ambient_light_disabled; - -uniform sampler2D depth_texture : hint_depth_texture; -uniform int step_count : hint_range(3, 15, 2) = 3; // 2 samples per step -uniform float thickness : hint_range(1.0, 16.0, 0.1) = 3.0; -uniform vec3 edge_color : source_color = vec3(0.); -uniform float fade_start : hint_range(1.0, 1000.0, 0.1) = 100.0; -uniform float fade_length : hint_range(1.0, 1000.0, 0.1) = 200.0; - -void fragment() { - // Setup step parameters - vec2 step_length = 1.0 / VIEWPORT_SIZE * thickness; - float step_angle = TAU / float(step_count); - // Per-pixel jitter to reduce patterning - float start_angle = fract(sin(dot(SCREEN_UV, vec2(12.9898, 78.233))) * 43758.5453) * TAU; - vec2 dir = vec2(cos(start_angle), sin(start_angle)); - // step rotation matrix - mat2 rot = mat2( - vec2(cos(step_angle), -sin(step_angle)), - vec2(sin(step_angle), cos(step_angle))); - vec3 avg_dx = vec3(0.0); - vec3 avg_dy = vec3(0.0); - // save closest pixel to uniformly fade line. - float min_z = 1e6; - // Sample and average derivatives for all pairs - for (int i = 0; i < step_count; i++) { - vec2 uv1 = SCREEN_UV + dir * step_length; - vec2 uv2 = SCREEN_UV - dir * step_length; - float d1 = texture(depth_texture, uv1).r; - float d2 = texture(depth_texture, uv2).r; - vec4 up1 = INV_PROJECTION_MATRIX * vec4(uv1 * 2.0 - 1.0, d1, 1.0); - vec4 up2 = INV_PROJECTION_MATRIX * vec4(uv2 * 2.0 - 1.0, d2, 1.0); - vec3 p1 = up1.xyz / up1.w; - vec3 p2 = up2.xyz / up2.w; - min_z = min(min_z, min(-p1.z, -p2.z)); - vec3 diff = p1 - p2; - avg_dx += diff * dir.x; - avg_dy += diff * dir.y; - - dir = rot * dir; // rotate direction for next step - } - // fade outline width with distance - float distance_fade = 1e-4 + smoothstep(fade_start + fade_length, fade_start, min_z); - - // Edge mask - float edge = 1.0 - smoothstep(0.1, 0.15, dot(normalize(cross(avg_dy, avg_dx)), VIEW)); - - // Small vignette at screen edges - edge *= smoothstep(0.00, 0.015 * thickness, - 1.0 - max(abs(SCREEN_UV.x - 0.5), abs(SCREEN_UV.y - 0.5)) * 2.0); - - // blend_premul_alpha avoids need to sample screentexture. - ALBEDO = edge_color * edge; - ALPHA = edge * distance_fade; -} \ No newline at end of file diff --git a/common/vfx/materials/shaders/outline.gdshader.uid b/common/vfx/materials/shaders/outline.gdshader.uid deleted file mode 100644 index 6a6ea21..0000000 --- a/common/vfx/materials/shaders/outline.gdshader.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bt4t4qrug135 diff --git a/common/vfx/materials/shaders/pixelisation.gdshader b/common/vfx/materials/shaders/pixelisation.gdshader deleted file mode 100644 index 95c2464..0000000 --- a/common/vfx/materials/shaders/pixelisation.gdshader +++ /dev/null @@ -1,19 +0,0 @@ -shader_type spatial; - -render_mode unshaded, fog_disabled; - -uniform sampler2D screen_texture : hint_screen_texture; -uniform float pixel_size : hint_range(0.0, 100., 2.0) = 8.0; - -void fragment() { - vec2 tex_size = vec2(textureSize(screen_texture, 0)); - vec2 pixel_count = tex_size / pixel_size; - vec2 pixelated_uv = floor(SCREEN_UV * pixel_count) / pixel_count; - vec4 color = texture(screen_texture, pixelated_uv); - ALBEDO = color.rgb; -} - -//void light() { -// // Called for every pixel for every light affecting the material. -// // Uncomment to replace the default light processing function with this one. -//} diff --git a/common/vfx/materials/shaders/pixelisation.gdshader.uid b/common/vfx/materials/shaders/pixelisation.gdshader.uid deleted file mode 100644 index de87346..0000000 --- a/common/vfx/materials/shaders/pixelisation.gdshader.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c3gjvpai3w7cu