commit
e85728b271
5 changed files with 464 additions and 0 deletions
@ -0,0 +1,302 @@ |
|||
import QtQuick 1.0 |
|||
import Qt.labs.shaders 1.0 |
|||
Rectangle { |
|||
width: 300 |
|||
height: 300 |
|||
color: "black" |
|||
|
|||
Rectangle { |
|||
id: texture |
|||
anchors.fill: parent |
|||
anchors.margins: 40 |
|||
gradient: Gradient { |
|||
GradientStop { |
|||
position: 0.0 |
|||
color: "lightblue" |
|||
} |
|||
|
|||
GradientStop { |
|||
position: 1.0 |
|||
color: "lightgreen" |
|||
} |
|||
} |
|||
|
|||
opacity: 0.75 |
|||
Grid { |
|||
columns: 3 |
|||
rows: 2 |
|||
spacing: 5 |
|||
|
|||
Repeater { |
|||
model: 6 |
|||
Item { |
|||
width: 75 |
|||
height: 75 |
|||
Rectangle { |
|||
color: "black" |
|||
opacity: 0.5 |
|||
anchors.fill: parent |
|||
} |
|||
Text { text: index; anchors.centerIn: parent; color: "white" } |
|||
} |
|||
} |
|||
} |
|||
|
|||
MouseArea { |
|||
anchors.fill: parent |
|||
|
|||
onClicked: console.debug("Clicked!!!") |
|||
} |
|||
} |
|||
|
|||
ShaderEffectItem { |
|||
property variant source: ShaderEffectSource { sourceItem: texture; hideSource: true } |
|||
property real wiggleAmount: 0.005 |
|||
property real angle: 0 |
|||
property real yPos: 0 |
|||
anchors.fill: texture |
|||
|
|||
SequentialAnimation on wiggleAmount { |
|||
loops: Animation.Infinite |
|||
NumberAnimation { |
|||
from: -0.005 |
|||
to: 0.005 |
|||
duration: 1000 |
|||
} |
|||
NumberAnimation { |
|||
from: 0.005 |
|||
to: -0.005 |
|||
duration: 1000 |
|||
} |
|||
} |
|||
|
|||
// SequentialAnimation on angle { |
|||
// loops: Animation.Infinite |
|||
// NumberAnimation { |
|||
// from: -3.1416 |
|||
// to: 3.1416 |
|||
// duration: 2000 |
|||
// } |
|||
// NumberAnimation { |
|||
// from: 3.1416 |
|||
// to: -3.1416 |
|||
// duration: 2000 |
|||
// } |
|||
// } |
|||
SequentialAnimation on angle { |
|||
loops: Animation.Infinite |
|||
NumberAnimation { |
|||
from: -3.1416 * 3.0 |
|||
to: 0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
NumberAnimation { |
|||
from: 0 |
|||
to: 3.1416 * 3.0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
} |
|||
|
|||
SequentialAnimation on yPos { |
|||
loops: Animation.Infinite |
|||
NumberAnimation { |
|||
from: 2.0 |
|||
to: 0.0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
NumberAnimation { |
|||
from: 0.0 |
|||
to: -2.0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
} |
|||
|
|||
fragmentShader: " |
|||
varying highp vec2 qt_TexCoord0; |
|||
uniform sampler2D source; |
|||
uniform highp float wiggleAmount; |
|||
|
|||
void main(void) |
|||
{ |
|||
highp vec2 wiggledTexCoord = qt_TexCoord0; |
|||
wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount; |
|||
gl_FragColor = texture2D(source, wiggledTexCoord.st); |
|||
}" |
|||
|
|||
vertexShader: " |
|||
uniform highp mat4 qt_ModelViewProjectionMatrix; |
|||
attribute highp vec4 qt_Vertex; |
|||
attribute highp vec2 qt_MultiTexCoord0; |
|||
varying highp vec2 qt_TexCoord0; |
|||
uniform highp float angle; |
|||
uniform highp float yPos; |
|||
void main(void) |
|||
{ |
|||
highp mat4 mat = mat4( 1.0, 0.0, 0.0, 0.0, |
|||
0.0, 1.0, 0.0, 0.0, |
|||
0.0, 0.0, 1.0, 10.0, |
|||
0.0, 0.0, 0.0, 1.0); |
|||
|
|||
highp mat4 rotationMatrix = mat4(1.0, 0.0, 0.0, 0.0, |
|||
0.0, cos(angle), -sin(angle), yPos, |
|||
0.0, sin(angle), cos(angle), 0.0, |
|||
0.0, 0.0, 0.0, 1.0); |
|||
|
|||
qt_TexCoord0 = qt_MultiTexCoord0; |
|||
|
|||
highp mat4 prjMat = qt_ModelViewProjectionMatrix * mat; |
|||
|
|||
gl_Position = prjMat * qt_Vertex * rotationMatrix; |
|||
}" |
|||
} |
|||
|
|||
Rectangle { |
|||
id: texture2 |
|||
anchors.fill: parent |
|||
anchors.margins: 40 |
|||
gradient: Gradient { |
|||
GradientStop { |
|||
position: 0.0 |
|||
color: "lightblue" |
|||
} |
|||
|
|||
GradientStop { |
|||
position: 1.0 |
|||
color: "lightgreen" |
|||
} |
|||
} |
|||
|
|||
opacity: 0.75 |
|||
Text { |
|||
id: textLabel2 |
|||
text: "Drasteee Svet" |
|||
anchors.centerIn: parent |
|||
font.pixelSize: 32 |
|||
color: "white" |
|||
|
|||
} |
|||
|
|||
MouseArea { |
|||
anchors.fill: parent |
|||
|
|||
onClicked: console.debug("Clicked2!!!") |
|||
} |
|||
} |
|||
|
|||
ShaderEffectItem { |
|||
property variant source: ShaderEffectSource { sourceItem: texture2; hideSource: true } |
|||
property real wiggleAmount: 0.005 |
|||
property real angle: 0 |
|||
property real yPos: 0 |
|||
anchors.fill: texture2 |
|||
|
|||
SequentialAnimation on wiggleAmount { |
|||
loops: Animation.Infinite |
|||
NumberAnimation { |
|||
from: -0.005 |
|||
to: 0.005 |
|||
duration: 1000 |
|||
} |
|||
NumberAnimation { |
|||
from: 0.005 |
|||
to: -0.005 |
|||
duration: 1000 |
|||
} |
|||
} |
|||
|
|||
// SequentialAnimation on angle { |
|||
// loops: Animation.Infinite |
|||
// NumberAnimation { |
|||
// from: -3.1416 |
|||
// to: 3.1416 |
|||
// duration: 2000 |
|||
// } |
|||
// NumberAnimation { |
|||
// from: 3.1416 |
|||
// to: -3.1416 |
|||
// duration: 2000 |
|||
// } |
|||
// } |
|||
SequentialAnimation on angle { |
|||
loops: Animation.Infinite |
|||
NumberAnimation { |
|||
from: 0 |
|||
to: 3.1416 * 3.0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
NumberAnimation { |
|||
from: -3.1416 * 3.0 |
|||
to: 0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
} |
|||
|
|||
SequentialAnimation on yPos { |
|||
loops: Animation.Infinite |
|||
NumberAnimation { |
|||
from: 0.0 |
|||
to: -2.0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
NumberAnimation { |
|||
from: 2.0 |
|||
to: 0.0 |
|||
duration: 2000 |
|||
|
|||
} |
|||
PauseAnimation { duration: 5000 } |
|||
} |
|||
|
|||
fragmentShader: " |
|||
varying highp vec2 qt_TexCoord0; |
|||
uniform sampler2D source; |
|||
uniform highp float wiggleAmount; |
|||
|
|||
void main(void) |
|||
{ |
|||
highp vec2 wiggledTexCoord = qt_TexCoord0; |
|||
wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount; |
|||
gl_FragColor = texture2D(source, wiggledTexCoord.st); |
|||
}" |
|||
|
|||
vertexShader: " |
|||
uniform highp mat4 qt_ModelViewProjectionMatrix; |
|||
attribute highp vec4 qt_Vertex; |
|||
attribute highp vec2 qt_MultiTexCoord0; |
|||
varying highp vec2 qt_TexCoord0; |
|||
uniform highp float angle; |
|||
uniform highp float yPos; |
|||
void main(void) |
|||
{ |
|||
highp mat4 mat = mat4( 1.0, 0.0, 0.0, 0.0, |
|||
0.0, 1.0, 0.0, 0.0, |
|||
0.0, 0.0, 1.0, 10.0, |
|||
0.0, 0.0, 0.0, 1.0); |
|||
|
|||
highp mat4 rotationMatrix = mat4(1.0, 0.0, 0.0, 0.0, |
|||
0.0, cos(angle), -sin(angle), yPos, |
|||
0.0, sin(angle), cos(angle), 0.0, |
|||
0.0, 0.0, 0.0, 1.0); |
|||
|
|||
qt_TexCoord0 = qt_MultiTexCoord0; |
|||
|
|||
highp mat4 prjMat = qt_ModelViewProjectionMatrix * mat; |
|||
|
|||
gl_Position = prjMat * qt_Vertex * rotationMatrix; |
|||
}" |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
/* File generated by Qt Creator, version 2.2.1 */ |
|||
|
|||
import QmlProject 1.1 |
|||
|
|||
Project { |
|||
mainFile: "QmlShaders.qml" |
|||
|
|||
/* Include .qml, .js, and image files from current directory and subdirectories */ |
|||
QmlFiles { |
|||
directory: "." |
|||
} |
|||
JavaScriptFiles { |
|||
directory: "." |
|||
} |
|||
ImageFiles { |
|||
directory: "." |
|||
} |
|||
/* List of plugin directories passed to QML runtime */ |
|||
// importPaths: [ "../exampleplugin" ] |
|||
} |
@ -0,0 +1,92 @@ |
|||
<!DOCTYPE QtCreatorProject> |
|||
<qtcreator> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.ActiveTarget</variable> |
|||
<value type="int">0</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.EditorSettings</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value key="EditorConfiguration.AutoIndent" type="bool">true</value> |
|||
<value key="EditorConfiguration.AutoSpacesForTabs" type="bool">false</value> |
|||
<value key="EditorConfiguration.Codec" type="QByteArray">System</value> |
|||
<value key="EditorConfiguration.DoubleIndentBlocks" type="bool">false</value> |
|||
<value key="EditorConfiguration.IndentBraces" type="bool">false</value> |
|||
<value key="EditorConfiguration.IndentSize" type="int">4</value> |
|||
<value key="EditorConfiguration.MouseNavigation" type="bool">true</value> |
|||
<value key="EditorConfiguration.PaddingMode" type="int">1</value> |
|||
<value key="EditorConfiguration.ScrollWheelZooming" type="bool">true</value> |
|||
<value key="EditorConfiguration.SmartBackspace" type="bool">false</value> |
|||
<value key="EditorConfiguration.SpacesForTabs" type="bool">true</value> |
|||
<value key="EditorConfiguration.TabKeyBehavior" type="int">0</value> |
|||
<value key="EditorConfiguration.TabSize" type="int">8</value> |
|||
<value key="EditorConfiguration.UseGlobal" type="bool">true</value> |
|||
<value key="EditorConfiguration.Utf8BomBehavior" type="int">1</value> |
|||
<value key="EditorConfiguration.addFinalNewLine" type="bool">true</value> |
|||
<value key="EditorConfiguration.cleanIndentation" type="bool">true</value> |
|||
<value key="EditorConfiguration.cleanWhitespace" type="bool">true</value> |
|||
<value key="EditorConfiguration.inEntireDocument" type="bool">false</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Target.0</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">QML Viewer</value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Viewer</value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlTarget</value> |
|||
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">-1</value> |
|||
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">-1</value> |
|||
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value> |
|||
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">0</value> |
|||
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">0</value> |
|||
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap"> |
|||
<valuelist key="Analyzer.Valgrind.AddedSupressionFiles" type="QVariantList"/> |
|||
<value key="Analyzer.Valgrind.FilterExternalIssues" type="bool">true</value> |
|||
<value key="Analyzer.Valgrind.NumCallers" type="int">25</value> |
|||
<valuelist key="Analyzer.Valgrind.RemovedSupressionFiles" type="QVariantList"/> |
|||
<value key="Analyzer.Valgrind.TrackOrigins" type="bool">true</value> |
|||
<value key="Analyzer.Valgrind.ValgrindExecutable" type="QString">valgrind</value> |
|||
<valuelist key="Analyzer.Valgrind.VisibleErrorKinds" type="QVariantList"> |
|||
<value type="int">0</value> |
|||
<value type="int">1</value> |
|||
<value type="int">2</value> |
|||
<value type="int">3</value> |
|||
<value type="int">4</value> |
|||
<value type="int">5</value> |
|||
<value type="int">6</value> |
|||
<value type="int">7</value> |
|||
<value type="int">8</value> |
|||
<value type="int">9</value> |
|||
<value type="int">10</value> |
|||
<value type="int">11</value> |
|||
<value type="int">12</value> |
|||
<value type="int">13</value> |
|||
<value type="int">14</value> |
|||
</valuelist> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString"></value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Viewer</value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlRunConfiguration</value> |
|||
<value key="QmlProjectManager.QmlRunConfiguration.MainScript" type="QString"></value> |
|||
<value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments" type="QString">-opengl</value> |
|||
<value key="QmlProjectManager.QmlRunConfiguration.QtVersion" type="int">2</value> |
|||
<valuelist key="QmlProjectManager.QmlRunConfiguration.UserEnvironmentChanges" type="QVariantList"/> |
|||
<value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value> |
|||
<value key="RunConfiguration.UseCppDebugger" type="bool">false</value> |
|||
<value key="RunConfiguration.UseQmlDebugger" type="bool">true</value> |
|||
</valuemap> |
|||
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.TargetCount</variable> |
|||
<value type="int">1</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|||
<value type="QString">{469d0d4b-7030-46bf-90f2-4d1625efce87}</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|||
<value type="int">9</value> |
|||
</data> |
|||
</qtcreator> |
@ -0,0 +1,50 @@ |
|||
<!DOCTYPE QtCreatorProject> |
|||
<qtcreator> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.ActiveTarget</variable> |
|||
<value type="int">0</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.EditorSettings</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value key="EditorConfiguration.Codec" type="QByteArray">Default</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Target.0</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">QML Viewer</value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Viewer</value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlTarget</value> |
|||
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">-1</value> |
|||
<value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">-1</value> |
|||
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value> |
|||
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">0</value> |
|||
<value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">0</value> |
|||
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap"> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString"></value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Viewer</value> |
|||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlRunConfiguration</value> |
|||
<value key="QmlProjectManager.QmlRunConfiguration.MainScript" type="QString"></value> |
|||
<value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments" type="QString"></value> |
|||
<value key="QmlProjectManager.QmlRunConfiguration.QtVersion" type="int">2</value> |
|||
<value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value> |
|||
<value key="RunConfiguration.UseCppDebugger" type="bool">false</value> |
|||
<value key="RunConfiguration.UseQmlDebugger" type="bool">true</value> |
|||
</valuemap> |
|||
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.TargetCount</variable> |
|||
<value type="int">1</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|||
<value type="QString">{469d0d4b-7030-46bf-90f2-4d1625efce87}</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|||
<value type="int">8</value> |
|||
</data> |
|||
</qtcreator> |
After Width: | Height: | Size: 3.0 KiB |
Loading…
Reference in new issue