mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-28 13:30:55 +00:00
Temporarily disabled composite processing to show the pure stream. Fixed both automatic calculations of phase — per line and, at input, per pixel.
This commit is contained in:
parent
c84004bfa3
commit
5740015f56
@ -29,7 +29,7 @@ void CRT::set_new_timing(unsigned int cycles_per_line, unsigned int height_of_di
|
|||||||
// for horizontal retrace and 500 to 750 µs for vertical retrace in NTSC and PAL TV."
|
// for horizontal retrace and 500 to 750 µs for vertical retrace in NTSC and PAL TV."
|
||||||
|
|
||||||
time_multiplier_ = IntermediateBufferWidth / cycles_per_line;
|
time_multiplier_ = IntermediateBufferWidth / cycles_per_line;
|
||||||
phase_denominator_ = cycles_per_line * colour_cycle_denominator;
|
phase_denominator_ = cycles_per_line * colour_cycle_denominator * time_multiplier_;
|
||||||
phase_numerator_ = 0;
|
phase_numerator_ = 0;
|
||||||
colour_cycle_numerator_ = colour_cycle_numerator;
|
colour_cycle_numerator_ = colour_cycle_numerator;
|
||||||
phase_alternates_ = should_alternate;
|
phase_alternates_ = should_alternate;
|
||||||
|
@ -132,9 +132,9 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
RenderStage composite_render_stages[] =
|
RenderStage composite_render_stages[] =
|
||||||
{
|
{
|
||||||
{&composite_texture_, composite_input_shader_program_.get(), {0.0, 0.0, 0.0}},
|
{&composite_texture_, composite_input_shader_program_.get(), {0.0, 0.0, 0.0}},
|
||||||
{&separated_texture_, composite_separation_filter_program_.get(), {0.0, 0.5, 0.5}},
|
// {&separated_texture_, composite_separation_filter_program_.get(), {0.0, 0.5, 0.5}},
|
||||||
{&filtered_y_texture_, composite_y_filter_shader_program_.get(), {0.0, 0.5, 0.5}},
|
// {&filtered_y_texture_, composite_y_filter_shader_program_.get(), {0.0, 0.5, 0.5}},
|
||||||
{&filtered_texture_, composite_chrominance_filter_shader_program_.get(), {0.0, 0.0, 0.0}},
|
// {&filtered_texture_, composite_chrominance_filter_shader_program_.get(), {0.0, 0.0, 0.0}},
|
||||||
{nullptr}
|
{nullptr}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ void OpenGLOutputBuilder::prepare_source_vertex_array()
|
|||||||
void OpenGLOutputBuilder::prepare_output_shader()
|
void OpenGLOutputBuilder::prepare_output_shader()
|
||||||
{
|
{
|
||||||
output_shader_program_ = OpenGL::OutputShader::make_shader("", "texture(texID, srcCoordinatesVarying).rgb", false);
|
output_shader_program_ = OpenGL::OutputShader::make_shader("", "texture(texID, srcCoordinatesVarying).rgb", false);
|
||||||
output_shader_program_->set_source_texture_unit(filtered_texture_unit);
|
output_shader_program_->set_source_texture_unit(composite_texture_unit);//filtered_texture_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLOutputBuilder::prepare_output_vertex_array()
|
void OpenGLOutputBuilder::prepare_output_vertex_array()
|
||||||
@ -367,6 +367,10 @@ void OpenGLOutputBuilder::set_colour_space_uniforms()
|
|||||||
|
|
||||||
void OpenGLOutputBuilder::set_timing_uniforms()
|
void OpenGLOutputBuilder::set_timing_uniforms()
|
||||||
{
|
{
|
||||||
|
const float colour_subcarrier_frequency = (float)colour_cycle_numerator_ / (float)colour_cycle_denominator_;
|
||||||
|
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[] = {
|
OpenGL::IntermediateShader *intermediate_shaders[] = {
|
||||||
composite_input_shader_program_.get(),
|
composite_input_shader_program_.get(),
|
||||||
composite_separation_filter_program_.get(),
|
composite_separation_filter_program_.get(),
|
||||||
@ -374,17 +378,13 @@ void OpenGLOutputBuilder::set_timing_uniforms()
|
|||||||
composite_chrominance_filter_shader_program_.get()
|
composite_chrominance_filter_shader_program_.get()
|
||||||
};
|
};
|
||||||
bool extends = false;
|
bool extends = false;
|
||||||
float phaseCyclesPerTick = (float)colour_cycle_numerator_ / (float)(colour_cycle_denominator_ * cycles_per_line_);
|
float phase_cycles_per_tick = 0.25f;
|
||||||
for(int c = 0; c < 3; c++)
|
for(int c = 0; c < 3; c++)
|
||||||
{
|
{
|
||||||
if(intermediate_shaders[c]) intermediate_shaders[c]->set_phase_cycles_per_sample(phaseCyclesPerTick, extends);
|
if(intermediate_shaders[c]) intermediate_shaders[c]->set_phase_cycles_per_sample(phase_cycles_per_tick, extends);
|
||||||
extends = true;
|
extends = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
float colour_subcarrier_frequency = (float)colour_cycle_numerator_ / (float)colour_cycle_denominator_;
|
|
||||||
float output_width = ((float)colour_cycle_numerator_ * 4.0f) / (float)(colour_cycle_denominator_ * IntermediateBufferWidth);
|
|
||||||
float sample_cycles_per_line = cycles_per_line_ / output_width;
|
|
||||||
|
|
||||||
if(composite_separation_filter_program_)
|
if(composite_separation_filter_program_)
|
||||||
{
|
{
|
||||||
composite_separation_filter_program_->set_width_scalers(output_width, output_width);
|
composite_separation_filter_program_->set_width_scalers(output_width, output_width);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user