mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-12 15:31:09 +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:
parent
3ea0d04a1a
commit
ce3c098c28
@ -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
|
// generate timing values implied by the given arbuments
|
||||||
_sync_capacitor_charge_threshold = ((syncCapacityLineChargeThreshold * _cycles_per_line) * 50) >> 7;
|
_sync_capacitor_charge_threshold = ((syncCapacityLineChargeThreshold * _cycles_per_line) * 50) >> 7;
|
||||||
const unsigned int vertical_retrace_time = scanlinesVerticalRetraceTime * _cycles_per_line;
|
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
|
// creat the two flywheels
|
||||||
unsigned int horizontal_retrace_time = scanlinesVerticalRetraceTime * _cycles_per_line;
|
unsigned int horizontal_retrace_time = scanlinesVerticalRetraceTime * _cycles_per_line;
|
||||||
|
@ -236,7 +236,7 @@ char *CRT::get_vertex_shader()
|
|||||||
|
|
||||||
"out float lateralVarying;"
|
"out float lateralVarying;"
|
||||||
"out vec2 shadowMaskCoordinates;"
|
"out vec2 shadowMaskCoordinates;"
|
||||||
"out float age;"
|
"out float alpha;"
|
||||||
|
|
||||||
"uniform vec2 textureSize;"
|
"uniform vec2 textureSize;"
|
||||||
"uniform float timestampBase;"
|
"uniform float timestampBase;"
|
||||||
@ -253,7 +253,8 @@ char *CRT::get_vertex_shader()
|
|||||||
"shadowMaskCoordinates = position * vec2(shadowMaskMultiple, shadowMaskMultiple * 0.85057471264368);"
|
"shadowMaskCoordinates = position * vec2(shadowMaskMultiple, shadowMaskMultiple * 0.85057471264368);"
|
||||||
|
|
||||||
"srcCoordinatesVarying = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);"
|
"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;"
|
"vec2 mappedPosition = (position - boundsOrigin) / boundsSize;"
|
||||||
"gl_Position = vec4(mappedPosition.x * 2.0 - 1.0, 1.0 - mappedPosition.y * 2.0, 0.0, 1.0);"
|
"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"
|
"#version 150\n"
|
||||||
|
|
||||||
"in float lateralVarying;"
|
"in float lateralVarying;"
|
||||||
"in float age;"
|
"in float alpha;"
|
||||||
"in vec2 shadowMaskCoordinates;"
|
"in vec2 shadowMaskCoordinates;"
|
||||||
"in vec2 srcCoordinatesVarying;"
|
"in vec2 srcCoordinatesVarying;"
|
||||||
|
|
||||||
@ -311,7 +312,7 @@ char *CRT::get_fragment_shader()
|
|||||||
|
|
||||||
"void main(void)"
|
"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);
|
, _rgb_shader);
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,6 @@ const int CRTInputBufferBuilderHeight = 1024;
|
|||||||
const int CRTIntermediateBufferWidth = 2048;
|
const int CRTIntermediateBufferWidth = 2048;
|
||||||
const int CRTIntermediateBufferHeight = 2048;
|
const int CRTIntermediateBufferHeight = 2048;
|
||||||
|
|
||||||
const int kCRTNumberOfFrames = 4;
|
const int kCRTNumberOfFrames = 3;
|
||||||
|
|
||||||
#endif /* CRTOpenGL_h */
|
#endif /* CRTOpenGL_h */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user