From 93ece2aec79c1eb3d0941d0b485353ed321a1c4d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 14 Jan 2018 20:44:53 -0500 Subject: [PATCH 1/2] "Doubles" the bandwidth given to composite signals. Because I suspect it may inadvertently have been halved previously. I'm investigating. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index 2c9ca50b8..e35d2728f 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -413,7 +413,7 @@ void OpenGLOutputBuilder::set_gamma() { } float OpenGLOutputBuilder::get_composite_output_width() const { - return (static_cast(colour_cycle_numerator_) * 4.0f) / static_cast(colour_cycle_denominator_ * IntermediateBufferWidth); + return static_cast(colour_cycle_numerator_ * 8) / static_cast(colour_cycle_denominator_ * IntermediateBufferWidth); } void OpenGLOutputBuilder::set_output_shader_width() { From 23c34a8c14ae7bdf449baf07fbb1389647c649e5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 15 Jan 2018 16:52:40 -0500 Subject: [PATCH 2/2] Corrects calculation of intermediate buffer width multiplier. Specifically: I had failed to factor in that the multiplied-up input frequency might be less than than the full width of the bitmap. The Atari and MSX in particular now look much better. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index e35d2728f..a95a15cb9 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -412,8 +412,16 @@ void OpenGLOutputBuilder::set_gamma() { if(output_shader_program_) output_shader_program_->set_gamma_ratio(gamma_); } +/*! + @returns The multiplier to apply to x positions received at the shader in order to produce locations in the intermediate + texture. Intermediate textures are in phase with the composite signal, so this is a function of (i) composite frequency + (determining how much of the texture adds up to a single line); and (ii) input frequency (determining what the input + positions mean as a fraction of a line). +*/ float OpenGLOutputBuilder::get_composite_output_width() const { - return static_cast(colour_cycle_numerator_ * 8) / static_cast(colour_cycle_denominator_ * IntermediateBufferWidth); + return + (static_cast(colour_cycle_numerator_ * 4) / static_cast(colour_cycle_denominator_ * IntermediateBufferWidth)) * + (static_cast(IntermediateBufferWidth) / static_cast(cycles_per_line_)); } void OpenGLOutputBuilder::set_output_shader_width() {