1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Made an attempt slightly to simplify the fragment processor, at both ends.

This commit is contained in:
Thomas Harte 2016-04-12 22:35:11 -04:00
parent fe8b0ebc7e
commit 4d889d9c7f
2 changed files with 4 additions and 4 deletions

View File

@ -59,12 +59,12 @@ void Machine::setup_output(float aspect_ratio)
{
_crt = std::unique_ptr<Outputs::CRT::CRT>(new Outputs::CRT::CRT(crt_cycles_per_line, 8, Outputs::CRT::DisplayType::PAL50, 1));
_crt->set_rgb_sampling_function(
"vec4 rgb_sample(usampler2D sampler, vec2 coordinate, vec2 icoordinate)"
"vec3 rgb_sample(usampler2D sampler, vec2 coordinate, vec2 icoordinate)"
"{"
"uint texValue = texture(sampler, coordinate).r;"
"texValue >>= 4 - (int(icoordinate.x * 2) & 1)*4;"
"return vec4(texValue & 4u, texValue & 2u, texValue & 1u, 1.0);"
// "return vec4(1.0);"
"return vec3( uvec3(texValue) & uvec3(4u, 2u, 1u));"
// "return vec3(1.0);"
"}");
_crt->set_output_device(Outputs::CRT::Monitor);
_crt->set_visible_area(_crt->get_rect_for_area(first_graphics_line - 3, 256, first_graphics_cycle * crt_cycles_multiplier, 80 * crt_cycles_multiplier, 4.0f / 3.0f));

View File

@ -416,7 +416,7 @@ char *OpenGLOutputBuilder::get_output_fragment_shader(const char *sampling_funct
"void main(void)"
"{"
"fragColour = rgb_sample(texID, srcCoordinatesVarying, iSrcCoordinatesVarying) * vec4(1.0, 1.0, 1.0, alpha);" //*sin(lateralVarying)
"fragColour = vec4(rgb_sample(texID, srcCoordinatesVarying, iSrcCoordinatesVarying), alpha);" //*sin(lateralVarying)
"}"
, sampling_function);
}