summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/decor.frag.glsl6
1 files changed, 4 insertions, 2 deletions
diff --git a/shaders/decor.frag.glsl b/shaders/decor.frag.glsl
index 77f9c95e..3e2c286f 100644
--- a/shaders/decor.frag.glsl
+++ b/shaders/decor.frag.glsl
@@ -8,7 +8,7 @@
// colour rides in the cell's ground (a_bg), its coverage in a_fg.r, so the
// result is the overlay pipeline's exactly.
//
-// Soft shadow (flag 0x10000000): a rectangle's shadow blurred by a Gaussian,
+// Soft (flag 0x10000000): a rectangle's shadow, rim or glow blurred by a Gaussian,
// in closed form (the product of two erf edges), on one quad grown by 3
// sigma: no blur pass. Everything is in the quad's own 0..1 space, so a
// track's transform carries it: sigma per axis in the uv, the caster's
@@ -62,7 +62,9 @@ void main() {
vec2 caster1 = 1.0 - m - v_fg.gb;
if (all(greaterThanEqual(p, caster0)) && all(lessThan(p, caster1))) discard;
float a = v_fg.r * edge(p.x, m.x, 1.0 - m.x, s.x) * edge(p.y, m.y, 1.0 - m.y, s.y);
- a = 1.0 - pow(max(1.0 - a, 0.0), 1.0 / 2.2);
+ // Black darkens in linear light; a light colour (a rim, a glow) is laid
+ // on as it is, within ยง8.2's 25%.
+ if (all(equal(v_bg, vec3(0.0)))) a = 1.0 - pow(max(1.0 - a, 0.0), 1.0 / 2.2);
a = clamp(a + (ign(gl_FragCoord.xy) - 0.5) / 255.0, 0.0, 1.0);
o_col = vec4(v_bg * opacity, a);
}