Scatter.qml 783 B

123456789101112131415161718192021222324252627282930
  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 TextureInput noiseSample: TextureInput {
  7. texture: Texture {
  8. tilingModeHorizontal: Texture.Repeat
  9. tilingModeVertical: Texture.Repeat
  10. source: "qrc:/qtquick3deffects/maps/brushnoise.png"
  11. }
  12. }
  13. property real amount: 10.0 // 0 - 127
  14. property int direction: 0 // 0 = both, 1 = horizontal, 2 = vertical
  15. property bool randomize: true
  16. Shader {
  17. id: scatter
  18. stage: Shader.Fragment
  19. shader: "qrc:/qtquick3deffects/shaders/scatter.frag"
  20. }
  21. passes: [
  22. Pass {
  23. shaders: [ scatter ]
  24. }
  25. ]
  26. }