mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 02:17:08 +00:00
Starts towards a flattening of the intermediate video processing.
Immediate issue: using x position to index into a bitmap sampled at the input data rate doesn't allow for the disconnection between input rate and output speed provided by the flywheels.
This commit is contained in:
@@ -14,10 +14,10 @@ using namespace Outputs::Display::OpenGL;
|
||||
namespace {
|
||||
|
||||
/// The texture unit from which to source input data.
|
||||
constexpr GLenum SourceDataTextureUnit = GL_TEXTURE0;
|
||||
constexpr GLenum SourceDataTextureUnit = GL_TEXTURE1;
|
||||
|
||||
/// The texture unit which contains raw line-by-line composite, S-Video or RGB data.
|
||||
constexpr GLenum UnprocessedLineBufferTextureUnit = GL_TEXTURE1;
|
||||
constexpr GLenum UnprocessedLineBufferTextureUnit = GL_TEXTURE3;
|
||||
|
||||
/// The texture unit that contains the current display.
|
||||
constexpr GLenum AccumulationTextureUnit = GL_TEXTURE2;
|
||||
@@ -288,7 +288,7 @@ void ScanTarget::setup_pipeline() {
|
||||
// lose any detail when combining the input.
|
||||
processing_width_ = modals_.cycles_per_line / modals_.clocks_per_pixel_greatest_common_divisor;
|
||||
|
||||
// Establish an output shader. TODO: add gamma correction here.
|
||||
// Establish an output shader. TODO: add proper decoding and gamma correction here.
|
||||
output_shader_.reset(new Shader(
|
||||
glsl_globals(ShaderType::Line) + glsl_default_vertex_shader(ShaderType::Line),
|
||||
"#version 150\n"
|
||||
@@ -312,8 +312,24 @@ void ScanTarget::setup_pipeline() {
|
||||
output_shader_->set_uniform("size", modals_.visible_area.size.width, modals_.visible_area.size.height);
|
||||
output_shader_->set_uniform("textureName", GLint(UnprocessedLineBufferTextureUnit - GL_TEXTURE0));
|
||||
|
||||
// switch(modals_.composite_colour_space) {
|
||||
// case ColourSpace::YIQ: {
|
||||
// const GLfloat rgbToYIQ[] = {0.299f, 0.596f, 0.211f, 0.587f, -0.274f, -0.523f, 0.114f, -0.322f, 0.312f};
|
||||
// const GLfloat yiqToRGB[] = {1.0f, 1.0f, 1.0f, 0.956f, -0.272f, -1.106f, 0.621f, -0.647f, 1.703f};
|
||||
// shader->set_uniform_matrix("lumaChromaToRGB", 3, false, yiqToRGB);
|
||||
// shader->set_uniform_matrix("rgbToLumaChroma", 3, false, rgbToYIQ);
|
||||
// } break;
|
||||
//
|
||||
// case ColourSpace::YUV: {
|
||||
// const GLfloat rgbToYUV[] = {0.299f, -0.14713f, 0.615f, 0.587f, -0.28886f, -0.51499f, 0.114f, 0.436f, -0.10001f};
|
||||
// const GLfloat yuvToRGB[] = {1.0f, 1.0f, 1.0f, 0.0f, -0.39465f, 2.03211f, 1.13983f, -0.58060f, 0.0f};
|
||||
// shader->set_uniform_matrix("lumaChromaToRGB", 3, false, yuvToRGB);
|
||||
// shader->set_uniform_matrix("rgbToLumaChroma", 3, false, rgbToYUV);
|
||||
// } break;
|
||||
// }
|
||||
|
||||
// Establish an input shader.
|
||||
input_shader_ = composition_shader();
|
||||
input_shader_ = composition_shader(modals_.input_data_type);
|
||||
glBindVertexArray(scan_vertex_array_);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, scan_buffer_name_);
|
||||
enable_vertex_attributes(ShaderType::InputScan, *input_shader_);
|
||||
@@ -492,7 +508,7 @@ void ScanTarget::draw(bool synchronous, int output_width, int output_height) {
|
||||
// Enable blending and stenciling, and ensure spans increment the stencil buffer.
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilFunc(GL_EQUAL, 0, GLuint(-1));
|
||||
glStencilFunc(GL_EQUAL, 0, GLuint(~0));
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
|
||||
|
||||
// Prepare to output lines.
|
||||
|
||||
Reference in New Issue
Block a user