diff --git a/Resources/Prototypes/Shaders/outline.yml b/Resources/Prototypes/Shaders/outline.yml index 8eb4acef91..8469e30158 100644 --- a/Resources/Prototypes/Shaders/outline.yml +++ b/Resources/Prototypes/Shaders/outline.yml @@ -4,6 +4,7 @@ path: "/Textures/Shaders/outline.swsl" params: outline_color: "#FF000055" + light_boost: 2 - type: shader id: SelectionOutlineInrange @@ -11,3 +12,4 @@ path: "/Textures/Shaders/outline.swsl" params: outline_color: "#00FF0055" + light_boost: 4 diff --git a/Resources/Textures/Shaders/outline.swsl b/Resources/Textures/Shaders/outline.swsl index a4d6b331f1..5f90df22bf 100644 --- a/Resources/Textures/Shaders/outline.swsl +++ b/Resources/Textures/Shaders/outline.swsl @@ -27,12 +27,10 @@ // //************************************************************************ -light_mode unshaded; -//shader_type canvas_item; uniform highp float outline_width; // = 2.0; -// TODO: implement that hint_color thingy. -//uniform vec4 outline_color: hint_color; uniform highp vec4 outline_color; // =vec4(1.0,0.0,0.0,0.33); +uniform bool outline_fullbright; // =false; +uniform highp float light_boost; // = 4.0; void fragment() { highp vec4 col = zTexture(UV); @@ -74,5 +72,7 @@ void fragment() { maxa = max(a, maxa); mina = min(a, mina); - COLOR = mix(col, outline_color, maxa-col.a); + float sampledLight = outline_fullbright ? 1.0 : sqrt(mix(0.0, 1.0, (lightSample.r * 0.34) + (lightSample.g * 0.5) + (lightSample.b * 0.16)) * light_boost); + COLOR = mix(col, outline_color * sampledLight, maxa - col.a); + lightSample = vec3(1.0); }