DistortionRipple.qml 818 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright (C) 2020 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick
  4. import QtQuick3D
  5. Effect {
  6. property real radius: 100.0 // 0 - 100
  7. property real distortionWidth: 10.0 // 2 - 100
  8. property real distortionHeight: 10.0 // 0 - 100
  9. property real distortionPhase: 0.0 // 0 - 360
  10. property vector2d center: Qt.vector2d(0.5, 0.5)
  11. Shader {
  12. id: distortionVert
  13. stage: Shader.Vertex
  14. shader: "qrc:/qtquick3deffects/shaders/distortion.vert"
  15. }
  16. Shader {
  17. id: distortionFrag
  18. stage: Shader.Fragment
  19. shader: "qrc:/qtquick3deffects/shaders/distortionripple.frag"
  20. }
  21. passes: [
  22. Pass {
  23. shaders: [ distortionVert, distortionFrag ]
  24. }
  25. ]
  26. }