{
  "format_version": 2,
  "sksl": {
    "entrypoint": "liquid_glass_render_fragment_main",
    "shader": "// This SkSL shader is autogenerated by spirv-cross.\n\nfloat4 flutter_FragCoord;\n\nuniform vec2 uSize;\nuniform vec2 uGeometryOffset;\nuniform vec2 uGeometrySize;\nuniform vec4 uGlassColor;\nuniform vec4 uOpticalProps;\nuniform vec3 uLightConfig;\nuniform vec2 uLightDirection;\nuniform float uWhiten;\nuniform float uWhitenGated;\nuniform float uPinchStrength;\nuniform vec4 uBackgroundFallback;\nuniform vec2 uCaptureOffset;\nuniform vec4 uEdgeConfig;\nuniform float uPlatformViewMode;\nuniform float uBodyMode;\nuniform vec2 uTouchPosition;\nuniform float uTouchIntensity;\nuniform shader uBackgroundTexture;\nuniform half2 uBackgroundTexture_size;\nuniform shader uGeometryTexture;\nuniform half2 uGeometryTexture_size;\n\nvec4 fragColor;\n\nvec2 FLT_flutter_local_FlutterFragCoord()\n{\n    return flutter_FragCoord.xy;\n}\n\nvec2 FLT_flutter_local_decodeNormalXY(vec4 encoded)\n{\n    return (encoded.xy * 2.0) - vec2(1.0);\n}\n\nfloat FLT_flutter_local_decodeHeight(vec4 encoded, float thickness)\n{\n    return encoded.z * thickness;\n}\n\nvec4 FLT_flutter_local_textureBilinear(vec2 uv, vec2 size, vec2 invSize)\n{\n    vec2 px = (uv * size) - vec2(0.5);\n    vec2 f = fract(px);\n    vec2 p0 = floor(px);\n    vec2 p1 = p0 + vec2(1.0, 0.0);\n    vec2 p2 = p0 + vec2(0.0, 1.0);\n    vec2 p3 = p0 + vec2(1.0);\n    vec4 c0 = uBackgroundTexture.eval(uBackgroundTexture_size * ( (p0 + vec2(0.5)) * invSize));\n    vec4 c1 = uBackgroundTexture.eval(uBackgroundTexture_size * ( (p1 + vec2(0.5)) * invSize));\n    vec4 c2 = uBackgroundTexture.eval(uBackgroundTexture_size * ( (p2 + vec2(0.5)) * invSize));\n    vec4 c3 = uBackgroundTexture.eval(uBackgroundTexture_size * ( (p3 + vec2(0.5)) * invSize));\n    vec4 cTop = mix(c0, c1, vec4(f.x));\n    vec4 cBot = mix(c2, c3, vec4(f.x));\n    vec4 bg = mix(cTop, cBot, vec4(f.y));\n    if (uBackgroundFallback.w > 0.0)\n    {\n        float _330 = bg.w;\n        vec4 _333 = bg;\n        vec3 _335 = _333.xyz + ((uBackgroundFallback.xyz * uBackgroundFallback.w) * (1.0 - _330));\n        bg.x = _335.x;\n        bg.y = _335.y;\n        bg.z = _335.z;\n        bg.w += (uBackgroundFallback.w * (1.0 - bg.w));\n    }\n    return bg;\n}\n\nvec4 FLT_flutter_local_applyGlassColor(vec4 liquidColor, vec4 glassColor, float bodyMode)\n{\n    vec3 directMix = mix(liquidColor.xyz, glassColor.xyz, vec3(glassColor.w));\n    if (bodyMode > 0.5)\n    {\n        return vec4(directMix, liquidColor.w);\n    }\n    float backdropLuminance = dot(liquidColor.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));\n    float glassLuminance = dot(glassColor.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));\n    vec3 tinted = clamp(glassColor.xyz + vec3(backdropLuminance - glassLuminance), vec3(0.0), vec3(1.0));\n    float chroma = max(max(glassColor.x, glassColor.y), glassColor.z) - min(min(glassColor.x, glassColor.y), glassColor.z);\n    float chromaWeight = clamp(chroma * 8.0, 0.0, 1.0);\n    vec3 luminosityMix = mix(liquidColor.xyz, tinted, vec3(glassColor.w));\n    return vec4(mix(directMix, luminosityMix, vec3(chromaWeight)), liquidColor.w);\n}\n\nvec3 FLT_flutter_local_applySaturation(vec3 color, float saturation)\n{\n    float luminance = dot(color, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));\n    vec3 saturatedColor = mix(vec3(luminance), color, vec3(saturation));\n    return clamp(saturatedColor, vec3(0.0), vec3(1.0));\n}\n\nvec3 FLT_flutter_local_getHighlightColor(vec3 backgroundColor, float targetBrightness)\n{\n    float luminance = dot(backgroundColor, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));\n    float maxComponent = max(max(backgroundColor.x, backgroundColor.y), backgroundColor.z);\n    float lum = luminance * 2.5;\n    float lumFactor = lum / (1.0 + lum);\n    float sat = maxComponent * 2.5;\n    float satFactor = sat / (1.0 + sat);\n    float colorInfluence = lumFactor * satFactor;\n    vec3 tinted = (backgroundColor / vec3(max(luminance, 0.001000000047497451305389404296875))) * targetBrightness;\n    return mix(vec3(targetBrightness), tinted, vec3(colorInfluence));\n}\n\nvoid FLT_main()\n{\n    float uRefractiveIndex = uOpticalProps.x;\n    float uChromaticAberration = uOpticalProps.y;\n    float uThickness = uOpticalProps.z;\n    float uLightIntensity = uLightConfig.x;\n    float uAmbientStrength = uLightConfig.y;\n    float uSaturation = uLightConfig.z;\n    vec2 fragCoord = FLT_flutter_local_FlutterFragCoord();\n    vec2 physTexSize = uSize;\n    vec2 invTexSize = vec2(1.0) / physTexSize;\n    vec2 screenUV = (fragCoord + uCaptureOffset) * invTexSize;\n    vec2 geometryUV = (fragCoord - uGeometryOffset) / uGeometrySize;\n    geometryUV = clamp(geometryUV, vec2(0.0), vec2(1.0));\n    vec4 geometryData = uGeometryTexture.eval(uGeometryTexture_size * ( geometryUV));\n    if (geometryData.w < 0.00999999977648258209228515625)\n    {\n        fragColor = vec4(0.0);\n        return;\n    }\n    vec4 param = geometryData;\n    vec2 normalXY = FLT_flutter_local_decodeNormalXY(param);\n    float normalZSq = max(0.0, 1.0 - dot(normalXY, normalXY));\n    float normalZ = sqrt(normalZSq);\n    vec3 normal = vec3(normalXY, normalZ);\n    vec4 param_1 = geometryData;\n    float param_2 = uThickness;\n    float height = FLT_flutter_local_decodeHeight(param_1, param_2);\n    float baseHeight = uThickness * 8.0;\n    vec3 incident = vec3(0.0, 0.0, -1.0);\n    float invN = 1.0 / max(uRefractiveIndex, 0.001000000047497451305389404296875);\n    vec3 baseRefract = refract(incident, normal, invN);\n    float refractLen = (height + baseHeight) / max(0.001000000047497451305389404296875, abs(baseRefract.z));\n    vec2 displacement = baseRefract.xy * refractLen;\n    displacement *= uOpticalProps.w;\n    float maxReach = 0.5 * min(uGeometrySize.x, uGeometrySize.y);\n    float reach = length(displacement);\n    if (reach > maxReach)\n    {\n        displacement *= (maxReach / reach);\n    }\n    if (uPinchStrength > 0.001000000047497451305389404296875)\n    {\n        vec2 centered = geometryUV - vec2(0.5);\n        vec2 absCentered = abs(centered) * 2.0;\n        float x2 = absCentered.x * absCentered.x;\n        float ax4 = x2 * x2;\n        float y2 = absCentered.y * absCentered.y;\n        float ay4 = y2 * y2;\n        float s = ax4 + ay4;\n        float squircleDist = sqrt(sqrt(s));\n        float pinchRamp = smoothstep(0.0, 1.0, squircleDist);\n        vec2 pinchShift = ((centered * pinchRamp) * uPinchStrength) * 0.02500000037252902984619140625;\n        pinchShift *= geometryData.w;\n        screenUV += pinchShift;\n        screenUV = clamp(screenUV, vec2(0.001000000047497451305389404296875), vec2(0.999000012874603271484375));\n    }\n    vec4 refractColor;\n    if (dot(normalXY, normalXY) < 9.9999997473787516355514526367188e-05)\n    {\n        vec2 param_3 = screenUV;\n        vec2 param_4 = physTexSize;\n        vec2 param_5 = invTexSize;\n        refractColor = FLT_flutter_local_textureBilinear(param_3, param_4, param_5);\n    }\n    else\n    {\n        if (uChromaticAberration < 0.00999999977648258209228515625)\n        {\n            vec2 refractedUV = screenUV + (displacement * invTexSize);\n            vec2 param_6 = refractedUV;\n            vec2 param_7 = physTexSize;\n            vec2 param_8 = invTexSize;\n            refractColor = FLT_flutter_local_textureBilinear(param_6, param_7, param_8);\n        }\n        else\n        {\n            float dispersionStrength = uChromaticAberration * 0.5;\n            vec2 redOffset = displacement * (1.0 + dispersionStrength);\n            vec2 blueOffset = displacement * (1.0 - dispersionStrength);\n            vec2 redUV = screenUV + (redOffset * invTexSize);\n            vec2 greenUV = screenUV + (displacement * invTexSize);\n            vec2 blueUV = screenUV + (blueOffset * invTexSize);\n            vec2 param_9 = redUV;\n            vec2 param_10 = physTexSize;\n            vec2 param_11 = invTexSize;\n            float red = FLT_flutter_local_textureBilinear(param_9, param_10, param_11).x;\n            vec2 param_12 = greenUV;\n            vec2 param_13 = physTexSize;\n            vec2 param_14 = invTexSize;\n            vec4 greenSample = FLT_flutter_local_textureBilinear(param_12, param_13, param_14);\n            vec2 param_15 = blueUV;\n            vec2 param_16 = physTexSize;\n            vec2 param_17 = invTexSize;\n            float blue = FLT_flutter_local_textureBilinear(param_15, param_16, param_17).z;\n            refractColor = vec4(red, greenSample.y, blue, greenSample.w);\n        }\n    }\n    if (refractColor.w > 0.001000000047497451305389404296875)\n    {\n        float _666 = refractColor.w;\n        vec4 _667 = refractColor;\n        vec3 _670 = _667.xyz / vec3(_666);\n        refractColor.x = _670.x;\n        refractColor.y = _670.y;\n        refractColor.z = _670.z;\n    }\n    vec4 param_18 = refractColor;\n    vec4 param_19 = uGlassColor;\n    float param_20 = uBodyMode;\n    vec4 finalColor = FLT_flutter_local_applyGlassColor(param_18, param_19, param_20);\n    float backdropLuma = dot(refractColor.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));\n    float adaptiveStrength = mix(1.2000000476837158203125, 0.800000011920928955078125, backdropLuma);\n    vec3 param_21 = finalColor.xyz;\n    float param_22 = uSaturation * adaptiveStrength;\n    vec3 _703 = FLT_flutter_local_applySaturation(param_21, param_22);\n    finalColor.x = _703.x;\n    finalColor.y = _703.y;\n    finalColor.z = _703.z;\n    vec4 _710 = finalColor;\n    vec3 _725 = mix(_710.xyz, uGlassColor.xyz, vec3(((uGlassColor.w * 0.119999997317790985107421875) * (adaptiveStrength - 1.0)) * (1.0 - uBodyMode)));\n    finalColor.x = _725.x;\n    finalColor.y = _725.y;\n    finalColor.z = _725.z;\n    float whitenLuma = dot(finalColor.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));\n    float whitenGate = mix(1.0, smoothstep(0.4000000059604644775390625, 0.800000011920928955078125, whitenLuma), uWhitenGated);\n    vec4 _743 = finalColor;\n    vec3 _752 = mix(_743.xyz, vec3(1.0), vec3(clamp(uWhiten, 0.0, 1.0) * whitenGate));\n    finalColor.x = _752.x;\n    finalColor.y = _752.y;\n    finalColor.z = _752.z;\n    float normalizedHeight = geometryData.z;\n    float baseScale = 40.0 * max(0.100000001490116119384765625, uEdgeConfig.z);\n    float thicknessScale = clamp(baseScale / max(uThickness, 1.0), 1.0, 4.0);\n    float edgeThreshold = mix(0.800000011920928955078125, 0.5, 1.0 / thicknessScale);\n    float _784;\n    if (uThickness < 0.00999999977648258209228515625)\n    {\n        _784 = 0.0;\n    }\n    else\n    {\n        _784 = 1.0 - smoothstep(0.0, edgeThreshold, normalizedHeight);\n    }\n    float edgeFactor = _784;\n    float r_rim = clamp(1.0 - normalizedHeight, 0.0, 1.0);\n    float _800;\n    if (uThickness < 0.00999999977648258209228515625)\n    {\n        _800 = 0.0;\n    }\n    else\n    {\n        _800 = sqrt(max(0.0, 1.0 - (r_rim * r_rim)));\n    }\n    float lensThickness = _800;\n    float rimThickness = 1.0 - lensThickness;\n    float len2D = max(length(normalXY), 9.9999997473787516355514526367188e-05);\n    vec2 rimN = normalXY / vec2(len2D);\n    float litness = dot(rimN, uLightDirection);\n    float dirScale = mix(1.39999997615814208984375, 0.60000002384185791015625, (litness * 0.5) + 0.5);\n    float absorption = 1.0 - ((sqrt(rimThickness) * uEdgeConfig.w) * dirScale);\n    vec4 _846 = finalColor;\n    vec3 _848 = _846.xyz * max(0.0, absorption);\n    finalColor.x = _848.x;\n    finalColor.y = _848.y;\n    finalColor.z = _848.z;\n    if (edgeFactor > 0.00999999977648258209228515625)\n    {\n        float len = max(length(normalXY), 9.9999997473787516355514526367188e-05);\n        vec2 anisoN = normalXY / vec2(len);\n        float mainLight = max(0.0, dot(anisoN, uLightDirection));\n        float oppositeLight = max(0.0, dot(anisoN, -uLightDirection));\n        float totalInfluence = mainLight + (oppositeLight * 0.800000011920928955078125);\n        float directional = ((totalInfluence * sqrt(totalInfluence)) * uLightIntensity) * 3.0;\n        float ambient = uAmbientStrength * 0.5;\n        float brightnessRaw = (((directional + ambient) * edgeFactor) * thicknessScale) * 0.800000011920928955078125;\n        float brightness = brightnessRaw / (1.0 + brightnessRaw);\n        vec3 param_23 = refractColor.xyz;\n        float param_24 = 1.0;\n        vec3 highlightColor = FLT_flutter_local_getHighlightColor(param_23, param_24);\n        vec4 _916 = finalColor;\n        vec3 _921 = mix(_916.xyz, highlightColor, vec3(brightness));\n        finalColor.x = _921.x;\n        finalColor.y = _921.y;\n        finalColor.z = _921.z;\n        if (uTouchIntensity > 0.001000000047497451305389404296875)\n        {\n            vec2 toFragPx = fragCoord - uTouchPosition;\n            float touchDist = length(toFragPx);\n            float dpr = max(1.0, uEdgeConfig.z * 3.0);\n            float touchRadius = max(70.0 * dpr, uSize.y * 1.5);\n            float distFactor = smoothstep(touchRadius, 0.0, touchDist);\n            if ((distFactor > 0.001000000047497451305389404296875) && (touchDist > 1.0))\n            {\n                vec2 touchDir = toFragPx / vec2(touchDist);\n                float rimTouchDot = max(0.0, dot(anisoN, touchDir));\n                float rtd2 = rimTouchDot * rimTouchDot;\n                float tSpec = ((rtd2 * rtd2) * rtd2) * distFactor;\n                float tBrightnessRaw = ((tSpec * uTouchIntensity) * uLightIntensity) * 2.5;\n                float tBrightness = tBrightnessRaw / (1.0 + tBrightnessRaw);\n                vec4 _1000 = finalColor;\n                vec3 _1007 = mix(_1000.xyz, highlightColor, vec3(tBrightness * edgeFactor));\n                finalColor.x = _1007.x;\n                finalColor.y = _1007.y;\n                finalColor.z = _1007.z;\n            }\n        }\n    }\n    float rimBase = (1.0 - normalZ) * edgeFactor;\n    float cosTerm = sqrt(max(0.0, 1.0 - (normalizedHeight * normalizedHeight)));\n    float rimDist = uThickness * (1.0 - cosTerm);\n    float ringWindow = 0.75 * max(0.100000001490116119384765625, uEdgeConfig.z);\n    float ring = (1.0 - smoothstep(uEdgeConfig.x - ringWindow, uEdgeConfig.x + ringWindow, rimDist)) * step(0.001000000047497451305389404296875, uEdgeConfig.x);\n    float fresnel = ((rimBase * 0.119999997317790985107421875) * uEdgeConfig.y) + (ring * 0.449999988079071044921875);\n    vec4 _1063 = finalColor;\n    vec3 _1070 = clamp(_1063.xyz + vec3(fresnel), vec3(0.0), vec3(1.0));\n    finalColor.x = _1070.x;\n    finalColor.y = _1070.y;\n    finalColor.z = _1070.z;\n    bool passthrough = uPlatformViewMode > 0.5;\n    float alpha = geometryData.w;\n    if (passthrough)\n    {\n        float rim = clamp(fresnel * 3.0, 0.0, 1.0);\n        alpha *= max(refractColor.w, rim);\n        vec4 _1098 = finalColor;\n        vec3 _1108 = mix(_1098.xyz, vec3(1.0), vec3((rim * (1.0 - refractColor.w)) * 0.85000002384185791015625));\n        finalColor.x = _1108.x;\n        finalColor.y = _1108.y;\n        finalColor.z = _1108.z;\n    }\n    fragColor = vec4(finalColor.xyz * alpha, alpha);\n}\n\nhalf4 main(float2 iFragCoord)\n{\n      flutter_FragCoord = float4(iFragCoord, 0, 0);\n      FLT_main();\n      return fragColor;\n}\n",
    "stage": 1,
    "uniforms": [
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 0,
        "name": "uSize",
        "rows": 2,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 1,
        "name": "uGeometryOffset",
        "rows": 2,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 2,
        "name": "uGeometrySize",
        "rows": 2,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 3,
        "name": "uGlassColor",
        "rows": 4,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 4,
        "name": "uOpticalProps",
        "rows": 4,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 5,
        "name": "uLightConfig",
        "rows": 3,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 6,
        "name": "uLightDirection",
        "rows": 2,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 7,
        "name": "uWhiten",
        "rows": 1,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 8,
        "name": "uWhitenGated",
        "rows": 1,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 9,
        "name": "uPinchStrength",
        "rows": 1,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 10,
        "name": "uBackgroundFallback",
        "rows": 4,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 11,
        "name": "uCaptureOffset",
        "rows": 2,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 12,
        "name": "uEdgeConfig",
        "rows": 4,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 13,
        "name": "uPlatformViewMode",
        "rows": 1,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 14,
        "name": "uBodyMode",
        "rows": 1,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 15,
        "name": "uTouchPosition",
        "rows": 2,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 32,
        "columns": 1,
        "location": 16,
        "name": "uTouchIntensity",
        "rows": 1,
        "type": 10
      },
      {
        "array_elements": 0,
        "bit_width": 0,
        "columns": 1,
        "location": 17,
        "name": "uBackgroundTexture",
        "rows": 1,
        "type": 12
      },
      {
        "array_elements": 0,
        "bit_width": 0,
        "columns": 1,
        "location": 18,
        "name": "uGeometryTexture",
        "rows": 1,
        "type": 12
      }
    ]
  }
}