From 2bd656676892848cee9ca489f7c99da546da826b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 24 Apr 2016 20:47:24 -0400 Subject: [PATCH] Oh, of course, I can use GL_CONSTANT_ALPHA so that new colours can be painted at alpha 1.0 while possibly saturating with old colours. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index 779db5608..4253df122 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -95,7 +95,8 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(unsigned int buffer_depth) : } _buffer_builder = std::unique_ptr(new CRTInputBufferBuilder(buffer_depth)); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_CONSTANT_ALPHA); + glBlendColor(1.0f, 1.0f, 1.0f, 0.33f); // Create intermediate textures and bind to slots 0, 1 and 2 glActiveTexture(composite_texture_unit); @@ -672,7 +673,7 @@ char *OpenGLOutputBuilder::get_output_vertex_shader(const char *header) "iSrcCoordinatesVarying = srcCoordinates;" "srcCoordinatesVarying = vec2(srcCoordinates.x / textureSize.x, (srcCoordinates.y + 0.5) / textureSize.y);" "float age = (timestampBase[int(lateralAndTimestampBaseOffset.y)] - timestamp) / ticksPerFrame;" - "alpha = 0.75;"//15.0*exp(-age*3.0);" + "alpha = 1.0;"//15.0*exp(-age*3.0);" "vec2 floatingPosition = (position / positionConversion) + lateralAndTimestampBaseOffset.x * scanNormal;" "vec2 mappedPosition = (floatingPosition - boundsOrigin) / boundsSize;"