diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index e388c6453..d9734646f 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -425,27 +425,16 @@ void OpenGLOutputBuilder::set_timing_uniforms() const float output_width = ((float)colour_cycle_numerator_ * 4.0f) / (float)(colour_cycle_denominator_ * IntermediateBufferWidth); const float sample_cycles_per_line = cycles_per_line_ / output_width; - OpenGL::IntermediateShader *intermediate_shaders[] = { - composite_input_shader_program_.get(), - composite_separation_filter_program_.get(), - composite_chrominance_filter_shader_program_.get() - }; - bool extends = false; - float phase_cycles_per_tick = 0.25f; - for(int c = 0; c < 3; c++) - { - if(intermediate_shaders[c]) intermediate_shaders[c]->set_phase_cycles_per_sample(phase_cycles_per_tick, extends); - extends = true; - } - if(composite_separation_filter_program_) { composite_separation_filter_program_->set_width_scalers(output_width, output_width); composite_separation_filter_program_->set_separation_frequency(sample_cycles_per_line, colour_subcarrier_frequency); + composite_separation_filter_program_->set_phase_cycles_per_sample(0.25f, 6.0f); } if(composite_chrominance_filter_shader_program_) { composite_chrominance_filter_shader_program_->set_width_scalers(output_width, output_width); + composite_chrominance_filter_shader_program_->set_phase_cycles_per_sample(0.25f, 5.0f); } if(rgb_filter_shader_program_) { @@ -460,6 +449,7 @@ void OpenGLOutputBuilder::set_timing_uniforms() if(composite_input_shader_program_) { composite_input_shader_program_->set_width_scalers(1.0f, output_width); + composite_input_shader_program_->set_phase_cycles_per_sample(0.25f, 0.0f); } if(rgb_input_shader_program_) { diff --git a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp index 06c1fa052..ebda43d6d 100644 --- a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp +++ b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp @@ -461,10 +461,10 @@ void IntermediateShader::set_separation_frequency(float sampling_rate, float col set_filter_coefficients(sampling_rate, colour_burst_frequency); } -void IntermediateShader::set_phase_cycles_per_sample(float phase_cycles_per_sample, bool extend_runs_to_full_cycle) +void IntermediateShader::set_phase_cycles_per_sample(float phase_cycles_per_sample, float extension) { set_uniform("phaseCyclesPerTick", (GLfloat)phase_cycles_per_sample); - set_uniform("extension", extend_runs_to_full_cycle ? ceilf(1.0f / phase_cycles_per_sample) : 0.0f); + set_uniform("extension", extension); } void IntermediateShader::set_colour_conversion_matrices(float *fromRGB, float *toRGB) diff --git a/Outputs/CRT/Internals/Shaders/IntermediateShader.hpp b/Outputs/CRT/Internals/Shaders/IntermediateShader.hpp index 046e3bb69..08a3c6e89 100644 --- a/Outputs/CRT/Internals/Shaders/IntermediateShader.hpp +++ b/Outputs/CRT/Internals/Shaders/IntermediateShader.hpp @@ -76,7 +76,7 @@ public: geometry should be extended so that a complete colour cycle is included at both the beginning and end, to occur upon the next `bind`. */ - void set_phase_cycles_per_sample(float phase_cycles_per_sample, bool extend_runs_to_full_cycle); + void set_phase_cycles_per_sample(float phase_cycles_per_sample, float extension); /*! Queues setting the matrices that convert between RGB and chrominance/luminance to occur on the next `bind`.