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

Eliminated phaseCyclesPerTick as implied.

This commit is contained in:
Thomas Harte 2017-01-08 16:48:02 -05:00
parent 79632b1d34
commit 28909e33ca
3 changed files with 6 additions and 8 deletions

View File

@ -429,12 +429,12 @@ void OpenGLOutputBuilder::set_timing_uniforms()
{
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);
composite_separation_filter_program_->set_extension(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);
composite_chrominance_filter_shader_program_->set_extension(5.0f);
}
if(rgb_filter_shader_program_)
{
@ -449,7 +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);
composite_input_shader_program_->set_extension(0.0f);
}
if(rgb_input_shader_program_)
{

View File

@ -40,7 +40,6 @@ std::unique_ptr<IntermediateShader> IntermediateShader::make_shader(const char *
"in vec2 ends;"
"in vec3 phaseTimeAndAmplitude;"
"uniform float phaseCyclesPerTick;"
"uniform ivec2 outputTextureSize;"
"uniform float extension;"
"uniform %s texID;"
@ -94,7 +93,7 @@ std::unique_ptr<IntermediateShader> IntermediateShader::make_shader(const char *
// setup phaseAndAmplitudeVarying.x as colour burst subcarrier phase, in radians;
// setup phaseAndAmplitudeVarying.x as colour burst amplitude
"phaseAndAmplitudeVarying.x = (phaseCyclesPerTick * (extendedOutputPosition.x - phaseTimeAndAmplitude.y) + (phaseTimeAndAmplitude.x / 256.0)) * 2.0 * 3.141592654;"
"phaseAndAmplitudeVarying.x = (((extendedOutputPosition.x - phaseTimeAndAmplitude.y) / 4.0) + (phaseTimeAndAmplitude.x / 256.0)) * 2.0 * 3.141592654;"
"phaseAndAmplitudeVarying.y = 0.33;" // TODO: reinstate connection with (phaseTimeAndAmplitude.y/256.0)
// determine output position by scaling the output position according to the texture size
@ -461,9 +460,8 @@ 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, float extension)
void IntermediateShader::set_extension(float extension)
{
set_uniform("phaseCyclesPerTick", (GLfloat)phase_cycles_per_sample);
set_uniform("extension", extension);
}

View File

@ -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, float extension);
void set_extension(float extension);
/*!
Queues setting the matrices that convert between RGB and chrominance/luminance to occur on the next `bind`.