diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 0d042a48c..5ef6b13ee 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -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; diff --git a/Outputs/CRT/CRTOpenGL.cpp b/Outputs/CRT/CRTOpenGL.cpp index abb31c638..0cd2db9bd 100644 --- a/Outputs/CRT/CRTOpenGL.cpp +++ b/Outputs/CRT/CRTOpenGL.cpp @@ -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); } diff --git a/Outputs/CRT/CRTOpenGL.hpp b/Outputs/CRT/CRTOpenGL.hpp index b3bfcd55f..bbf6f3df1 100644 --- a/Outputs/CRT/CRTOpenGL.hpp +++ b/Outputs/CRT/CRTOpenGL.hpp @@ -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 */