summaryrefslogtreecommitdiffstats
path: root/nodes/extra/bars.qen
blob: d671c84575ca77c33188bc13b9a181605748b466 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
    "QEN": {
        "description": "Animated bars effect.",
        "fragmentCode": [
            "@main",
            "{",
            "    float px = 1.0 / iResolution.x;",
            "    float sbar = iResolution.x / barsBarWidth * 0.5;",
            "    float movement = -iTime * px * barsAnimationSpeed;",
            "    float p = ((fragCoord.x + fragCoord.y * barsBarAngle) * px + movement) * sbar;",
            "    float bar = abs(2.0 * fract(p) - 1.0);",
            "    float barSmoothness = 2.0 / barsBarWidth;",
            "    bar = smoothstep(0.5 - barSmoothness, 0.5 + barSmoothness, bar);",
            "    fragColor = mix(barsColor1, barsColor2, bar);",
            "}"
        ],
        "name": "Bars",
        "properties": [
            {
                "defaultValue": "0, 0, 0, 1",
                "description": "First color of the bars.",
                "name": "barsColor1",
                "type": "color"
            },
            {
                "defaultValue": "1, 1, 1, 1",
                "description": "Second color of the bars.",
                "name": "barsColor2",
                "type": "color"
            },
            {
                "defaultValue": "30",
                "description": "Width of the bars in pixels.",
                "maxValue": "100",
                "minValue": "4",
                "name": "barsBarWidth",
                "type": "float"
            },
            {
                "defaultValue": "50",
                "description": "How fast the bars animate in pixels per second.",
                "maxValue": "200",
                "minValue": "-200",
                "name": "barsAnimationSpeed",
                "type": "float"
            },
            {
                "defaultValue": "0.5",
                "description": "Rotation angle of the bars.",
                "maxValue": "1",
                "minValue": "-1",
                "name": "barsBarAngle",
                "type": "float"
            }
        ],
        "version": 1
    }
}