1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Attempts to factor actual composite amplitude into output.

This commit is contained in:
Thomas Harte 2019-01-13 14:45:17 -05:00
parent 7c2c243985
commit e89e55a9bb

View File

@ -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
// give chrominance.
"float luminance = dot(samples, vec4(0.25));"
"float luminance = dot(samples, vec4(0.25 / (1.0 - compositeAmplitude)));"
"samples -= vec4(luminance);"
// Split and average chrominance.
"vec2 channels = vec2("
"dot(cos(angles), samples),"
"dot(sin(angles), samples)"
") * vec2(0.25);"
") * vec2(0.125 * oneOverCompositeAmplitude);"
// Apply a colour space conversion to get RGB.
"fragColour3 = lumaChromaToRGB * vec3(luminance, channels);";