Last active
December 10, 2015 13:28
-
-
Save usagi/4441640 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Row { | |
Image { | |
id: image | |
width: 200 | |
height: 200 | |
source: "usagi-logo.png" | |
} | |
ShaderEffect { | |
width: 300 | |
height: 300 | |
property var source: image | |
vertexShader: | |
" | |
uniform highp mat4 qt_Matrix; | |
attribute highp vec4 qt_Vertex; | |
attribute highp vec2 qt_MultiTexCoord0; | |
varying highp vec2 qt_TexCoord0; | |
void main() { | |
qt_TexCoord0 = qt_MultiTexCoord0; | |
gl_Position = qt_Matrix * qt_Vertex; | |
} | |
" | |
fragmentShader: | |
" | |
varying highp vec2 qt_TexCoord0; | |
uniform sampler2D source; | |
uniform lowp float qt_Opacity; | |
void main() { | |
gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity; | |
} | |
" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment