1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +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 // 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);";