mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Added some very basic filtering in RGB mode.
This commit is contained in:
parent
49a36ec9ac
commit
75d6ec354b
@ -417,7 +417,7 @@ const char *Machine::get_signal_decoder()
|
||||
return
|
||||
"vec4 sample(vec2 coordinate)\n"
|
||||
"{\n"
|
||||
"float texValue = texture(texID, srcCoordinatesVarying).r;\n"
|
||||
"float texValue = texture(texID, coordinate).r;\n"
|
||||
"return vec4( step(4.0/256.0, mod(texValue, 8.0/256.0)), step(2.0/256.0, mod(texValue, 4.0/256.0)), step(1.0/256.0, mod(texValue, 2.0/256.0)), 1.0);\n"
|
||||
"}";
|
||||
}
|
||||
|
@ -297,10 +297,12 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
||||
"srcCoordinatesVarying[0] = srcCoordinatesVarying[0] - vec2(0.325 / textureSize.x, 0.0);\n";
|
||||
|
||||
NSString *const rgbVertexShaderGlobals =
|
||||
@"out vec2 srcCoordinatesVarying;\n";
|
||||
@"out vec2 srcCoordinatesVarying[3];\n";
|
||||
|
||||
NSString *const rgbVertexShaderBody =
|
||||
@"srcCoordinatesVarying = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);\n";
|
||||
@"srcCoordinatesVarying[1] = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);\n"
|
||||
"srcCoordinatesVarying[0] = srcCoordinatesVarying[1] - vec2(0.5 / textureSize.x, 0.0);\n"
|
||||
"srcCoordinatesVarying[2] = srcCoordinatesVarying[1] + vec2(0.5 / textureSize.x, 0.0);\n";
|
||||
|
||||
NSString *const vertexShader =
|
||||
@"#version 150\n"
|
||||
@ -387,10 +389,12 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
||||
"fragColour = 5.0 * texture(shadowMaskTexID, shadowMaskCoordinates) * vec4(yiqToRGB * vec3(y, i, q), 1.0);//sin(lateralVarying));\n";
|
||||
|
||||
NSString *const rgbFragmentShaderGlobals =
|
||||
@"in vec2 srcCoordinatesVarying;\n"; // texture(shadowMaskTexID, shadowMaskCoordinates) *
|
||||
@"in vec2 srcCoordinatesVarying[3];\n"; // texture(shadowMaskTexID, shadowMaskCoordinates) *
|
||||
|
||||
NSString *const rgbFragmentShaderBody =
|
||||
@"fragColour = sample(srcCoordinatesVarying);//sin(lateralVarying));\n";
|
||||
@"fragColour = (sample(srcCoordinatesVarying[0]) + (sample(srcCoordinatesVarying[1]) * 2.0) + sample(srcCoordinatesVarying[2])) / 4.0;";
|
||||
|
||||
// dot(vec3(1.0/6.0, 2.0/3.0, 1.0/6.0), vec3(sample(srcCoordinatesVarying[0]), sample(srcCoordinatesVarying[0]), sample(srcCoordinatesVarying[0])));//sin(lateralVarying));\n";
|
||||
|
||||
switch(_signalType)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user