From 52726257f95cea5104c6156f2aa4eba1acae7f06 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Tue, 6 Aug 2019 09:27:14 +0200 Subject: [PATCH] improve stroke hard mix shader --- data/shaders/include/blend-stroke.glsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/shaders/include/blend-stroke.glsl b/data/shaders/include/blend-stroke.glsl index 142ca9e..860fed7 100644 --- a/data/shaders/include/blend-stroke.glsl +++ b/data/shaders/include/blend-stroke.glsl @@ -13,7 +13,9 @@ mediump float blend_stroke_hard_light(highp float base, highp float stroke) highp float blend_stroke_hard_mix(highp float base, highp float stroke) { - return base + stroke < 0.5 ? 0.0 : base + stroke; + if (base == 0.0) + return 0.0; + return base + stroke < 0.5 ? 0.0 : clamp(base + stroke, 0.0, 1.0); } highp float blend_stroke_color_dodge(highp float base, highp float stroke)