DistortionSphere.qml 697 B

1234567891011121314151617181920212223242526272829
  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: 0.25 // 0 - 1
  7. property real distortionHeight: 0.5 // -1 - 1
  8. property vector2d center: Qt.vector2d(0.5, 0.5)
  9. Shader {
  10. id: distortionVert
  11. stage: Shader.Vertex
  12. shader: "qrc:/qtquick3deffects/shaders/distortion.vert"
  13. }
  14. Shader {
  15. id: distortionFrag
  16. stage: Shader.Fragment
  17. shader: "qrc:/qtquick3deffects/shaders/distortionsphere.frag"
  18. }
  19. passes: [
  20. Pass {
  21. shaders: [ distortionVert, distortionFrag ]
  22. }
  23. ]
  24. }