{
    "QEN": {
        "description": "This node creates a medium quality but fast drop shadow of the source item. It uses mipmap levels and does not require BlurHelper node.",
        "extraMargin": 80,
        "fragmentCode": [
            "@requires NoiseHelper",
            "@main",
            "{",
            "    const vec2 uv = texCoord + (1.0 - mipmapDropShadowScale) * (texCoord - 1.0);",
            "    const vec2 offset = vec2(mipmapDropShadowHorizontalOffset, mipmapDropShadowVerticalOffset);",
            "    const float lod = sqrt(mipmapDropShadowBlurAmount);",
            "    const vec3 r = mipmapDropShadowScatterAmount * lod * (hash23(fragCoord) - vec3(0.5));",
            "    const vec2 cCoord = vec2((2.0 - mipmapDropShadowScale) * uv - 0.01 * offset) + vec2(r.xy * 0.01);",
            "    float mipmapDropShadowAlpha;",
            "    if (mipmapDropShadowQualityLow) {",
            "        mipmapDropShadowAlpha = textureLod(iSource, cCoord, lod).a;",
            "    } else {",
            "        // Take textures from suitable mipmap level, with offsets",
            "        const float m = (1.0 + r.z);",
            "        const float o = m * mipmapDropShadowBlurAmount / iResolution.x * 0.5;",
            "        vec2 lo1 = cCoord + vec2(o, o);",
            "        vec2 lo2 = cCoord + vec2(o, -o);",
            "        vec2 lo3 = cCoord + vec2(-o, o);",
            "        vec2 lo4 = cCoord + vec2(-o, -o);",
            "        float a = textureLod(iSource, cCoord, lod).a;",
            "        float a1 = textureLod(iSource, lo1, lod).a;",
            "        float a2 = textureLod(iSource, lo2, lod).a;",
            "        float a3 = textureLod(iSource, lo3, lod).a;",
            "        float a4 = textureLod(iSource, lo4, lod).a;",
            "        mipmapDropShadowAlpha = (0.28 * a + 0.18 * a1 + 0.18 * a2 + 0.18 * a3 + 0.18 * a4);",
            "    }",
            "    float mipmapDropShadowAA = (1.0 - fragColor.a) * (1.0 - mipmapDropShadowAlpha);",
            "    fragColor = mix(mipmapDropShadowColor * mipmapDropShadowAlpha, fragColor, fragColor.a + mipmapDropShadowAA);",
            "}"
        ],
        "name": "Mipmap Drop Shadow",
        "properties": [
            {
                "defaultValue": "2",
                "description": "This property defines how much blur is applied to the shadow. By default the value is set to 2.0.",
                "maxValue": "30",
                "minValue": "0",
                "name": "mipmapDropShadowBlurAmount",
                "displayName": "Blur Amount",
                "type": "float"
            },
            {
                "defaultValue": "0",
                "description": "This value defines the amount of scatter (randomness) in the shadow. This creates frosty looking shadow.",
                "maxValue": "1",
                "minValue": "0",
                "name": "mipmapDropShadowScatterAmount",
                "displayName": "Scatter Amount",
                "type": "float"
            },
            {
                "defaultValue": "1",
                "description": "This property defines scaling applied to the shadow. By default the value is set to 1.0 (no scaling).",
                "maxValue": "1.1",
                "minValue": "0.9",
                "name": "mipmapDropShadowScale",
                "displayName": "Scale",
                "type": "float"
            },
            {
                "defaultValue": "2",
                "description": "Defines shadow vertical offset in percentages relative to the source item.",
                "maxValue": "10",
                "minValue": "-10",
                "name": "mipmapDropShadowVerticalOffset",
                "displayName": "Vertical Offset",
                "type": "float"
            },
            {
                "defaultValue": "2",
                "description": "Defines shadow horizontal offset in percentages relative to the source item.",
                "maxValue": "10",
                "minValue": "-10",
                "name": "mipmapDropShadowHorizontalOffset",
                "displayName": "Horizontal Offset",
                "type": "float"
            },
            {
                "defaultValue": "0, 0, 0, 1",
                "description": "Defines shadow color.",
                "name": "mipmapDropShadowColor",
                "displayName": "Color",
                "type": "color"
            },
            {
                "defaultValue": "false",
                "description": "When this is false, only a single texture lookup is used for the shadow. With this shadow blur is very fast but also quite low quality.",
                "name": "mipmapDropShadowQualityLow",
                "displayName": "Low Quality",
                "type": "bool"
            }
        ],
        "version": 1
    }
}
