summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_saturation.sc
blob: c14f61601c87feb58531451e26b870a1a7985a2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$input v_color0, v_texcoord0

// license:BSD-3-Clause
// copyright-holders:Ryan Holtz

#include "common.sh"

// User-supplied
uniform vec4 u_saturation;

// Samplers
SAMPLER2D(s_tex, 0);

void main()
{
	vec4 base = texture2D(s_tex, v_texcoord0);
	vec3 rgb = base.rgb;

	vec3 gray = vec3(0.299, 0.587, 0.114);
	float luma = dot(rgb, gray);
	vec3 chroma = rgb - luma;
	vec3 saturated = luma + chroma * u_saturation.x;

	gl_FragColor = vec4(saturated, base.a);
}