mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Improve shader formatting
This commit is contained in:
@@ -15,15 +15,13 @@ uniform vec2 grad_vec;
|
||||
void main() {
|
||||
vec2 coords = v_coords * size + grad_offset;
|
||||
|
||||
if ((grad_vec.x < 0.0 && 0.0 <= grad_vec.y)
|
||||
|| (0.0 <= grad_vec.x && grad_vec.y < 0.0)) {
|
||||
if ((grad_vec.x < 0.0 && 0.0 <= grad_vec.y) || (0.0 <= grad_vec.x && grad_vec.y < 0.0))
|
||||
coords.x -= grad_width;
|
||||
}
|
||||
|
||||
float frac = dot(coords, grad_vec) / dot(grad_vec, grad_vec);
|
||||
|
||||
if (grad_vec.y < 0.0)
|
||||
frac = 1.0 + frac;
|
||||
frac += 1.0;
|
||||
|
||||
frac = clamp(frac, 0.0, 1.0);
|
||||
vec4 out_color = mix(color_from, color_to, frac);
|
||||
|
||||
Reference in New Issue
Block a user