{
    "QEN": {
        "description": "This effect creats a wavy sea with reflection of the source item. Requires texture lookup of the source, so should be used among first nodes.",
        "fragmentCode": [
            "@main",
            "{",
            "    vec2 tc = vec2(texCoord.s, 1. - texCoord.t);",
            "",
            "    const float p = seaReflectionPerspective + (1. - seaReflectionPerspective) *  texCoord.y;",
            "    const float w = (1.0001 - seaReflectionWaveSize) * 5;",
            "    const float wave1 = 0.5 * sin(30 * w * (0.5 - texCoord.y) / p + iTime * 5) * p;",
            "",
            "    float wave2 = sin((0.5 - texCoord.x) * 25 * w / p) * sin( iTime - texCoord.y * 40 * w / p) * p;",
            "    wave2 += sin(2 * iTime + ((0.5 - texCoord.y) * 4 * w / p + sin(2 * iTime - texCoord.y * w * 3) * 0.1 / w * sin((0.5 - texCoord.x) * w * 10 / p)) * 10 * w) * p;",
            "    wave2 *= 0.4;",
            "",
            "    const float combinedWaves = (wave1 + wave2) * 0.2;",
            "",
            "    tc.y += (wave1 + 0.2 * wave2) * seaReflectionDistortionFactor;",
            "    tc.x += 0.2 * combinedWaves * seaReflectionDistortionFactor;",
            "",
            "    vec4 texColor = texture(iSource, tc);",
            "",
            "    texColor.rgb *= seaReflectionColor.rgb * 2;",
            "",
            "    fragColor = vec4(mix(seaReflectionColor.rgb,  texColor.rgb - combinedWaves * seaReflectionColorFactor, seaReflectionReflectiveness * texColor.a), 1.0);",
            "}"
        ],
        "name": "Sea Reflection",
        "properties": [
            {
                "defaultValue": "0.15, 0.5, 0.9, 1",
                "description": "Sets  the color of the reflective sea. The source texture colors are multiplied with this color to colorize the reflection.",
                "name": "seaReflectionColor",
                "displayName": "Color",
                "type": "color"
            },
            {
                "defaultValue": "0.7",
                "description": "Sets the size of the waves. 1 is the size of the source texture and 0 is very small.",
                "maxValue": "1",
                "minValue": "0",
                "name": "seaReflectionWaveSize",
                "displayName": "Wave Size",
                "type": "float"
            },
            {
                "defaultValue": "0.2",
                "description": "Sets the perspective that makes the horizon seem further away. 0 is infinitely far and 1 disables the perspective completely.",
                "maxValue": "1",
                "minValue": "0",
                "name": "seaReflectionPerspective",
                "displayName": "Perspective",
                "type": "float"
            },
            {
                "defaultValue": "0.5",
                "description": "Sets how much the colors are intensified by the waves.",
                "maxValue": "1",
                "minValue": "0",
                "name": "seaReflectionColorFactor",
                "displayName": "Color Factor",
                "type": "float"
            },
            {
                "defaultValue": "1",
                "description": "Sets how much the reflection is distorted by the waves.",
                "maxValue": "3",
                "minValue": "0",
                "name": "seaReflectionDistortionFactor",
                "displayName": "Distortion Factor",
                "type": "float"
            },
            {
                "defaultValue": "0.4",
                "description": "Sets how much the texture is reflected. When set to 0, only the color is rendered with no reflection at all.",
                "maxValue": "1",
                "minValue": "0",
                "name": "seaReflectionReflectiveness",
                "displayName": "Reflectiveness",
                "type": "float"
            }
        ],
        "version": 1
    }
}
