From 0594668387587a49ae0d3c04cb09561ac36bddca Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Tue, 23 Dec 2014 00:16:03 +0100 Subject: [PATCH] Fix: clamp frame to black when outside texture boundaries. --- app/qml/frames/utils/TerminalFrame.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/qml/frames/utils/TerminalFrame.qml b/app/qml/frames/utils/TerminalFrame.qml index 14b7b96..6bd971f 100644 --- a/app/qml/frames/utils/TerminalFrame.qml +++ b/app/qml/frames/utils/TerminalFrame.qml @@ -61,6 +61,7 @@ Item{ sourceItem: frameimage hideSource: true textureSize: Qt.size(parent.width, parent.height) + sourceRect: Qt.rect(-1, -1, frameimage.width + 2, frameimage.height + 2) visible: false } ShaderEffectSource{ @@ -68,6 +69,7 @@ Item{ sourceItem: framenormals hideSource: true textureSize: Qt.size(parent.width, parent.height) + sourceRect: Qt.rect(-1, -1, framenormals.width + 2, framenormals.height + 2) visible: false } @@ -146,7 +148,7 @@ Item{ vec3 normal = normalize(txtNormal.rgb * 2.0 - 1.0); vec2 lightDirection = normalize(vec2(0.5, 0.5) - coords); - float dotProd = dot(normal, vec3(lightDirection, 0.0)) * diffuseComponent; + float dotProd = dot(normal, vec3(lightDirection, 0.0)) * diffuseComponent * txtNormal.a; vec3 darkColor = dotProd * reflectionColor.rgb; gl_FragColor = vec4(mix(darkColor, txtColor.rgb, ambient_light), dotProd);