mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-29 12:50:28 +00:00
Attempts to factor actual composite amplitude into output.
This commit is contained in:
parent
7c2c243985
commit
e89e55a9bb
@ -516,14 +516,14 @@ std::unique_ptr<Shader> ScanTarget::conversion_shader(InputDataType input_data_t
|
|||||||
|
|
||||||
// Take the average to calculate luminance, then subtract that from all four samples to
|
// Take the average to calculate luminance, then subtract that from all four samples to
|
||||||
// give chrominance.
|
// give chrominance.
|
||||||
"float luminance = dot(samples, vec4(0.25));"
|
"float luminance = dot(samples, vec4(0.25 / (1.0 - compositeAmplitude)));"
|
||||||
"samples -= vec4(luminance);"
|
"samples -= vec4(luminance);"
|
||||||
|
|
||||||
// Split and average chrominance.
|
// Split and average chrominance.
|
||||||
"vec2 channels = vec2("
|
"vec2 channels = vec2("
|
||||||
"dot(cos(angles), samples),"
|
"dot(cos(angles), samples),"
|
||||||
"dot(sin(angles), samples)"
|
"dot(sin(angles), samples)"
|
||||||
") * vec2(0.25);"
|
") * vec2(0.125 * oneOverCompositeAmplitude);"
|
||||||
|
|
||||||
// Apply a colour space conversion to get RGB.
|
// Apply a colour space conversion to get RGB.
|
||||||
"fragColour3 = lumaChromaToRGB * vec3(luminance, channels);";
|
"fragColour3 = lumaChromaToRGB * vec3(luminance, channels);";
|
||||||
|
Loading…
Reference in New Issue
Block a user