aboutsummaryrefslogtreecommitdiffstats
path: root/src/effects/Scatter.qml
blob: 87b3b4bfdd109f42d37534ba8c8968c8c803436c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick
import QtQuick3D

Effect {
    property TextureInput noiseSample: TextureInput {
        texture: Texture {
            tilingModeHorizontal: Texture.Repeat
            tilingModeVertical: Texture.Repeat
            source: "qrc:/qtquick3deffects/maps/brushnoise.png"
        }
    }
    property real amount: 10.0      // 0 - 127
    property int direction: 0       // 0 = both, 1 = horizontal, 2 = vertical
    property bool randomize: true

    Shader {
        id: scatter
        stage: Shader.Fragment
        shader: "qrc:/qtquick3deffects/shaders/scatter.frag"
    }

    passes: [
        Pass {
            shaders: [ scatter ]
        }
    ]
}