1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Widened beam a little, moved to a linear approximation of age across scans, cut number of stored frames.

This commit is contained in:
Thomas Harte 2016-02-16 21:48:09 -05:00
parent 3ea0d04a1a
commit ce3c098c28
3 changed files with 7 additions and 6 deletions

View File

@ -44,7 +44,7 @@ void CRT::set_new_timing(unsigned int cycles_per_line, unsigned int height_of_di
// generate timing values implied by the given arbuments
_sync_capacitor_charge_threshold = ((syncCapacityLineChargeThreshold * _cycles_per_line) * 50) >> 7;
const unsigned int vertical_retrace_time = scanlinesVerticalRetraceTime * _cycles_per_line;
const float halfLineWidth = (float)_height_of_display * 2.5f;
const float halfLineWidth = (float)_height_of_display * 1.94f;
// creat the two flywheels
unsigned int horizontal_retrace_time = scanlinesVerticalRetraceTime * _cycles_per_line;

View File

@ -236,7 +236,7 @@ char *CRT::get_vertex_shader()
"out float lateralVarying;"
"out vec2 shadowMaskCoordinates;"
"out float age;"
"out float alpha;"
"uniform vec2 textureSize;"
"uniform float timestampBase;"
@ -253,7 +253,8 @@ char *CRT::get_vertex_shader()
"shadowMaskCoordinates = position * vec2(shadowMaskMultiple, shadowMaskMultiple * 0.85057471264368);"
"srcCoordinatesVarying = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);"
"age = (timestampBase - timestamp) / ticksPerFrame;"
"float age = (timestampBase - timestamp) / ticksPerFrame;"
"alpha = min(10.0 * exp(-age * 2.0), 1.0);"
"vec2 mappedPosition = (position - boundsOrigin) / boundsSize;"
"gl_Position = vec4(mappedPosition.x * 2.0 - 1.0, 1.0 - mappedPosition.y * 2.0, 0.0, 1.0);"
@ -298,7 +299,7 @@ char *CRT::get_fragment_shader()
"#version 150\n"
"in float lateralVarying;"
"in float age;"
"in float alpha;"
"in vec2 shadowMaskCoordinates;"
"in vec2 srcCoordinatesVarying;"
@ -311,7 +312,7 @@ char *CRT::get_fragment_shader()
"void main(void)"
"{"
"fragColour = vec4(rgb_sample(srcCoordinatesVarying).rgb, 10.0 * exp(-age * 2.0) * sin(lateralVarying));"
"fragColour = vec4(rgb_sample(srcCoordinatesVarying).rgb, alpha * sin(lateralVarying));" //
"}"
, _rgb_shader);
}

View File

@ -22,6 +22,6 @@ const int CRTInputBufferBuilderHeight = 1024;
const int CRTIntermediateBufferWidth = 2048;
const int CRTIntermediateBufferHeight = 2048;
const int kCRTNumberOfFrames = 4;
const int kCRTNumberOfFrames = 3;
#endif /* CRTOpenGL_h */