From 34bd8c60ae6d6163608503137f08a69e6f27775d Mon Sep 17 00:00:00 2001 From: Lyzev Date: Sat, 15 Jun 2024 13:47:53 +0200 Subject: [PATCH] fixed bug (second try) --- src/main/kotlin/dev/lyzev/api/opengl/shader/Shaders.kt | 1 + .../kotlin/dev/lyzev/api/opengl/shader/blur/BlurHelper.kt | 1 + .../features/module/modules/render/ModuleToggleableBlur.kt | 1 + .../assets/schizoid/shaders/core/Tint/Tint_FP.glsl | 7 ++++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/lyzev/api/opengl/shader/Shaders.kt b/src/main/kotlin/dev/lyzev/api/opengl/shader/Shaders.kt index 81b5ba9ada..477272c5a4 100644 --- a/src/main/kotlin/dev/lyzev/api/opengl/shader/Shaders.kt +++ b/src/main/kotlin/dev/lyzev/api/opengl/shader/Shaders.kt @@ -279,6 +279,7 @@ object ShaderGameOfLife : ShaderCompute("GameOfLife", 32, 1, 1) { ShaderTint["Color"] = ImGuiScreenFeature.colorScheme[ImGuiScreenFeature.mode].particleIdle ShaderTint["RGBPuke"] = false ShaderTint["Opacity"] = 1f + ShaderTint["Alpha"] = true ShaderTint["Multiplier"] = 1f ShaderTint["Time"] = (System.nanoTime() - ShaderTint.initTime) / 1000000000f val yaw = MathHelper.lerpAngleDegrees(mc.tickDelta, mc.player?.yaw ?: 0f, mc.player?.prevYaw ?: 0f) diff --git a/src/main/kotlin/dev/lyzev/api/opengl/shader/blur/BlurHelper.kt b/src/main/kotlin/dev/lyzev/api/opengl/shader/blur/BlurHelper.kt index 7536bfb18a..d250e2b291 100644 --- a/src/main/kotlin/dev/lyzev/api/opengl/shader/blur/BlurHelper.kt +++ b/src/main/kotlin/dev/lyzev/api/opengl/shader/blur/BlurHelper.kt @@ -178,6 +178,7 @@ object BlurHelper { ShaderTint["Color"] = dropShadowColor ShaderTint["RGBPuke"] = ModuleToggleableBlur.dropShadowRGBPuke ShaderTint["Opacity"] = 1f + ShaderTint["Alpha"] = true ShaderTint["Multiplier"] = ModuleToggleableBlur.dropShadowMultiplier / 100f ShaderTint["Time"] = (System.nanoTime() - ShaderTint.initTime) / 1000000000f val yaw = MathHelper.lerpAngleDegrees(mc.tickDelta, mc.player?.yaw ?: 0f, mc.player?.prevYaw ?: 0f) diff --git a/src/main/kotlin/dev/lyzev/schizoid/feature/features/module/modules/render/ModuleToggleableBlur.kt b/src/main/kotlin/dev/lyzev/schizoid/feature/features/module/modules/render/ModuleToggleableBlur.kt index b64355fc5d..9ba0c8bbb4 100644 --- a/src/main/kotlin/dev/lyzev/schizoid/feature/features/module/modules/render/ModuleToggleableBlur.kt +++ b/src/main/kotlin/dev/lyzev/schizoid/feature/features/module/modules/render/ModuleToggleableBlur.kt @@ -170,6 +170,7 @@ object ModuleToggleableBlur : ShaderTint["Tex0"] = 0 ShaderTint["RGBPuke"] = fogRGBPuke ShaderTint["Opacity"] = fogRGBPukeOpacity / 100f + ShaderTint["Alpha"] = false ShaderTint["Multiplier"] = 1f ShaderTint["Time"] = (System.nanoTime() - ShaderAcrylic.initTime) / 1000000000f val yaw = MathHelper.lerpAngleDegrees(mc.tickDelta, mc.player?.yaw ?: 0f, mc.player?.prevYaw ?: 0f) diff --git a/src/main/resources/assets/schizoid/shaders/core/Tint/Tint_FP.glsl b/src/main/resources/assets/schizoid/shaders/core/Tint/Tint_FP.glsl index a2b9589d9a..8f9e266887 100644 --- a/src/main/resources/assets/schizoid/shaders/core/Tint/Tint_FP.glsl +++ b/src/main/resources/assets/schizoid/shaders/core/Tint/Tint_FP.glsl @@ -14,6 +14,7 @@ uniform sampler2D Tex0; uniform vec3 Color; uniform bool RGBPuke; uniform float Opacity; +uniform bool Alpha; uniform float Multiplier; uniform float Time; uniform float Yaw; @@ -32,5 +33,9 @@ void main() { } else { color.rgb = mix(color.rgb, Color, Opacity); } - color.a = clamp(color.a * Multiplier, 0.0, 1.0); + if (Alpha) { + color.a = clamp(color.a * Multiplier, 0.0, 1.0); + } else { + color.a = 1.0; + } }