From 0c65385c82c31bf25281b1b7a3a82f4b82c7a7b4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 Jun 2018 18:24:32 -0400 Subject: [PATCH 1/3] Undoes older interpretation of alternating phase. I now understand, hopefully, that it's only the phase of the second colour component that alternates. That has the pointwise effect of reversing the colour signal. Hence the effect of phase errors cancelling themselves out up on successive lines up to a point. --- Outputs/CRT/CRT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 7f0f4f20b..9a1cae3ae 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -375,7 +375,7 @@ void CRT::output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint } void CRT::output_default_colour_burst(unsigned int number_of_cycles) { - output_colour_burst(number_of_cycles, static_cast((phase_numerator_ * 256) / phase_denominator_ + (is_alernate_line_ ? 128 : 0))); + output_colour_burst(number_of_cycles, static_cast((phase_numerator_ * 256) / phase_denominator_)); } void CRT::set_immediate_default_phase(float phase) { From 41dcf1de4225c530b46498e746ffb7cf95840d08 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 Jun 2018 18:25:04 -0400 Subject: [PATCH 2/3] Increases blur again just a little more, after consideration of interlaced output. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 2 +- Outputs/CRT/Internals/Shaders/OutputShader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index 9b5b27abd..cfe48fc67 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -37,7 +37,7 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(std::size_t bytes_per_pixel) : texture_builder(bytes_per_pixel, source_data_texture_unit), array_builder(SourceVertexBufferDataSize, OutputVertexBufferDataSize) { glBlendFunc(GL_SRC_ALPHA, GL_CONSTANT_COLOR); - glBlendColor(0.3f, 0.3f, 0.3f, 1.0f); + glBlendColor(0.4f, 0.4f, 0.4f, 1.0f); // create the output vertex array glGenVertexArrays(1, &output_vertex_array_); diff --git a/Outputs/CRT/Internals/Shaders/OutputShader.cpp b/Outputs/CRT/Internals/Shaders/OutputShader.cpp index 899d8f504..0ab9c2ff3 100644 --- a/Outputs/CRT/Internals/Shaders/OutputShader.cpp +++ b/Outputs/CRT/Internals/Shaders/OutputShader.cpp @@ -83,7 +83,7 @@ std::unique_ptr OutputShader::make_shader(const char *fragment_met "void main(void)" "{" - "fragColour = vec4(pow(" << colour_expression << ", vec3(gamma)), 0.9);"//*cos(lateralVarying) + "fragColour = vec4(pow(" << colour_expression << ", vec3(gamma)), 0.8);"//*cos(lateralVarying) "}"; return std::unique_ptr(new OutputShader(vertex_shader.str(), fragment_shader.str(), { From 14a2e470e453e06ed9a359c7132822cb769dae42 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 Jun 2018 18:25:48 -0400 Subject: [PATCH 3/3] Corrects overbrightness issue with autogeneration of PAL composite from an RGB source. --- Outputs/CRT/Internals/Shaders/IntermediateShader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp index 630d09ce1..b191bdcf2 100644 --- a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp +++ b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp @@ -146,7 +146,7 @@ std::unique_ptr IntermediateShader::make_composite_source_sh "vec3 rgbColour = clamp(rgb_sample(texID, coordinate, iCoordinate), vec3(0.0), vec3(1.0));" "vec3 lumaChromaColour = rgbToLumaChroma * rgbColour;" "vec2 quadrature = vec2(cos(phase), sin(phase)) * vec2(abs(amplitude), amplitude);" - "return dot(lumaChromaColour, vec3(1.0 - amplitude, quadrature));" + "return dot(lumaChromaColour, vec3(1.0 - abs(amplitude), quadrature));" "}"; } }