{
    "QEN": {
        "description": "This node generates a water waves effect.",
        "fragmentCode": [
            "#define TAU 6.28318530718",
            "",
            "@main",
            "{",
            "    const float time = 1.0 + iTime * 0.6;",
            "    const vec2 uv = texCoord;",
            "    const vec2 p = mod(uv * TAU, TAU) + 10.0;",
            "    const float inten = 0.05;",
            "    vec2 ip = p;",
            "    float c = 0.0;",
            "    for (int n = 0; n < waterLayers; n++) {",
            "        float t = time * (1.0 / float(n + 0.4));",
            "        ip = p + vec2(cos(t - ip.x) + sin(t + ip.y), sin(t - ip.y) + cos(t + ip.x));",
            "        c += 1.0 / length(vec2(p.x / (sin(ip.x + t) / inten), p.y / (cos(ip.y + t) / inten)));",
            "    }",
            "    c /= float(waterLayers);",
            "    c = max(0.0, 1.2 - (c * c));",
            "    vec3 water = waterColor.rgb + vec3(pow(c, 4.0)) * (2.0 * waterWavesColor.rgb - 1.0);",
            "    fragColor = mix(fragColor, vec4(water, 1.0) * fragColor.a, waterColor.a);",
            "}"
        ],
        "name": "Water",
        "properties": [
            {
                "defaultValue": "4",
                "description": "How many water wave layers there are. More layers means more resource usage.",
                "name": "waterLayers",
                "maxValue": "8",
                "minValue": "2",
                "displayName": "Layers",
                "type": "int"
            },
            {
                "defaultValue": "0, 0.2, 0.4, 0.5",
                "description": "Color used for the water. Alpha channel defines the opacity of the effect.",
                "name": "waterColor",
                "displayName": "Color",
                "type": "color"
            },
            {
                "defaultValue": "0.2, 0.8, 0.8, 1",
                "description": "Color used for the water waves.",
                "name": "waterWavesColor",
                "displayName": "Waves Color",
                "type": "color"
            }
        ],
        "version": 1
    }
}
