Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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