From 9ff570e8699a1938abbddfb5fe0c79c694cb52e3 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Thu, 14 Sep 2023 21:37:48 -0400 Subject: [PATCH] make electrified thing stainable --- shaders/electricity.gdshader | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/shaders/electricity.gdshader b/shaders/electricity.gdshader index bd685c5..a86dad4 100644 --- a/shaders/electricity.gdshader +++ b/shaders/electricity.gdshader @@ -111,15 +111,19 @@ float snoise(vec3 v) { void fragment() { - vec4 tex_color = texture(TEXTURE, UV); - tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / (gamma + sin(TIME * flash_rate) * flash_intensity))); -// tex_color.rgb = pow(tex_color.rgb, vec3(0.5 + sin(TIME * 20.0) * 0.1)); -// tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / 2.0)); -// tex_color.rgb += (round(sin(TIME * 20.0) * 4.0)) * 0.25 * 0.05; - float n = snoise(vec3(SCREEN_UV / SCREEN_PIXEL_SIZE / arc_scale, floor(TIME * arc_fps) * arc_speed / arc_fps)); - n = step(abs(n), arc_threshold); - COLOR = vec4(mix(tex_color.rgb, arc_color.rgb, n * arc_color.a), tex_color.a); -// float worley = worley(SCREEN_UV, 128.0, 96.0); -// vec4 tex_color = texture(TEXTURE, UV); -// COLOR = vec4(mix(vec3(1.0, 1.0, 0.2), tex_color.rgb, step(worley, 0.5)), tex_color.a); + if (AT_LIGHT_PASS) { + COLOR = vec4(1.0, 1.0, 1.0, COLOR.a); + } else { + vec4 tex_color = texture(TEXTURE, UV); + tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / (gamma + sin(TIME * flash_rate) * flash_intensity))); + // tex_color.rgb = pow(tex_color.rgb, vec3(0.5 + sin(TIME * 20.0) * 0.1)); + // tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / 2.0)); + // tex_color.rgb += (round(sin(TIME * 20.0) * 4.0)) * 0.25 * 0.05; + float n = snoise(vec3(SCREEN_UV / SCREEN_PIXEL_SIZE / arc_scale, floor(TIME * arc_fps) * arc_speed / arc_fps)); + n = step(abs(n), arc_threshold); + COLOR = vec4(mix(tex_color.rgb, arc_color.rgb, n * arc_color.a), tex_color.a); + // float worley = worley(SCREEN_UV, 128.0, 96.0); + // vec4 tex_color = texture(TEXTURE, UV); + // COLOR = vec4(mix(vec3(1.0, 1.0, 0.2), tex_color.rgb, step(worley, 0.5)), tex_color.a); + } } \ No newline at end of file