From 17615a9f14b5eb3c4049767ad43fe000d194ff61 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Wed, 9 Jul 2014 19:15:56 +0200 Subject: [PATCH] Fix #10: implicit cast in shader. --- app/PreprocessedTerminal.qml | 47 +++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index 2472422..8bad84f 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -239,29 +239,31 @@ Item{ uniform highp vec2 virtual_resolution;" + - (mBlur !== 0 ? - "uniform lowp sampler2D blurredSource;" - : "") + + (mBlur !== 0 ? + "uniform lowp sampler2D blurredSource;" + : "") + - "void main() {" + - "vec2 coords = qt_TexCoord0;" + - (mScanlines != shadersettings.no_rasterization ? " - coords.y = floor(virtual_resolution.y * coords.y) / virtual_resolution.y;" + - (mScanlines == shadersettings.pixel_rasterization ? " - coords.x = floor(virtual_resolution.x * coords.x) / virtual_resolution.x;" : "") - : "") + - "coords = coords + delta;" + - "vec4 vcolor = texture2D(source, coords).r * 256.0; - float color = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b + 0.04;" + - (mBlur !== 0 ? - "float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" + - "blurredSourceColor = blurredSourceColor - blurredSourceColor * " + (1.0 - motionBlurCoefficient) * fpsAttenuation+ ";" + - "color = step(1.0, color) * color + step(color, 1.0) * blurredSourceColor;" - : "") + + "void main() {" + + "vec2 coords = qt_TexCoord0;" + + (mScanlines != shadersettings.no_rasterization ? " + coords.y = floor(virtual_resolution.y * coords.y) / virtual_resolution.y;" + + (mScanlines == shadersettings.pixel_rasterization ? " + coords.x = floor(virtual_resolution.x * coords.x) / virtual_resolution.x;" : "") + : "") + + "coords = coords + delta;" + + "vec4 vcolor = texture2D(source, coords) * 256.0; + float color = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b + 0.04;" + + (mBlur !== 0 ? + "float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" + + "blurredSourceColor = blurredSourceColor - blurredSourceColor * " + (1.0 - motionBlurCoefficient) * fpsAttenuation+ ";" + + "color = step(1.0, color) * color + step(color, 1.0) * blurredSourceColor;" + : "") + - "gl_FragColor.a = floor(color) / 256.0;" + - "}" + "gl_FragColor.a = floor(color) / 256.0;" + + "}" + + onStatusChanged: if (log) console.log(log) //Print warning messages } /////////////////////////////////////////////////////////////////////////// // EFFECTS ////////////////////////////////////////////////////////////// @@ -330,6 +332,8 @@ Item{ "void main() {" + "gl_FragColor.a = smoothNoise(qt_TexCoord0 * virtual_resolution);" + "}" + + onStatusChanged: if (log) console.log(log) //Print warning messages } ShaderEffectSource{ id: staticNoiseSource @@ -403,7 +407,10 @@ Item{ "gl_FragColor.a = color;" + "}" + + onStatusChanged: if (log) console.log(log) //Print warning messages } + onStatusChanged: if (log) console.log(log) //Print warning messages } ShaderEffectSource{ id: rasterizationEffectSource