{
  "version": 1,
  "name": "Prism Nocturne",
  "parameters": {
    "Scene": 0,
    "Sensitivity": 0.6,
    "Motion": 0.55,
    "Hue": 0.51,
    "Opacity": 1,
    "Intensity": 0.82,
    "Size": 0.5,
    "Deformation": 0.73,
    "Glow": 0,
    "Trails": 0.6,
    "ShaderMix": 1,
    "Shader01": 0.4,
    "Shader02": 0.58,
    "Shader03": 1,
    "Shader04": 0.72,
    "Shader05": 0.68,
    "Shader06": 0.7,
    "Shader07": 0.66,
    "Shader08": 0.35,
    "Shader09": 0.46,
    "Shader10": 0.49,
    "Shader11": 0.64,
    "Shader12": 0.42,
    "Shader13": 0.45,
    "Shader14": 0.164,
    "Shader15": 0.58,
    "Shader16": 0.46
  },
  "decoration": {
    "label": "NOCTURNE",
    "logoBase64": null,
    "labelColor": -921356,
    "backdropColor": -15723738,
    "labelScale": 0.23,
    "labelX": 0.5,
    "labelY": 0.5,
    "backdrop": "Transparent",
    "hideNativeEffect": false,
    "scene3D": null,
    "sceneModelPath": null,
    "shader": {
      "name": "Prism Nocturne \u00B7 Folded glass",
      "graphJson": null,
      "hlsl": "float PeakParticleHash(float2 key)\r\n{\r\n    float3 value = frac(float3(key.xyx) * 0.1031);\r\n    value \u002B= dot(value, value.yzx \u002B 33.33);\r\n    return frac((value.x \u002B value.y) * value.z);\r\n}\r\n\r\nfloat4 PeakParticleBurst(float2 plane, float originRadius, float age, float strength, float amount, float seed)\r\n{\r\n    const float lifetime = 0.62;\r\n    const float sectors = 24.0;\r\n    const float radiansPerSector = 6.2831853 / sectors;\r\n    float opacity = saturate(amount) * saturate(strength);\r\n    [branch] if (age \u003C 0.0 || age \u003E= lifetime || opacity \u003C 0.004)\r\n        return 0.0;\r\n\r\n    float radius = length(plane);\r\n    float expansion = 1.0 - exp2(-age * 4.0);\r\n    [branch] if (radius \u003C originRadius \u002B 0.030 || radius \u003E originRadius \u002B 0.23 \u002B 0.41 * expansion)\r\n        return 0.0;\r\n\r\n    float angle = frac(atan2(plane.y, plane.x) / 6.2831853 \u002B 1.0) * sectors;\r\n    float sector = floor(angle);\r\n    float pixel = max(TexelSize.x, TexelSize.y);\r\n    float life = smoothstep(0.0, 0.025, age \u002B 0.008) * (1.0 - smoothstep(0.14, lifetime, age));\r\n    float4 result = 0.0;\r\n\r\n    // Check overlapping angular cells so trails and bloom stay continuous across the polar seam.\r\n    [unroll] for (int neighbor = -1; neighbor \u003C= 1; neighbor\u002B\u002B)\r\n    {\r\n        float cell = sector \u002B neighbor;\r\n        float wrapped = cell - sectors * floor(cell / sectors);\r\n        [unroll] for (int lane = 0; lane \u003C 2; lane\u002B\u002B)\r\n        {\r\n            float2 key = float2(wrapped \u002B lane * 33.0, seed);\r\n            float variation = PeakParticleHash(key \u002B float2(0.73, 3.47));\r\n            float visibility = opacity * life * smoothstep(0.0, 0.18, variation \u002B amount - 0.42 - lane * 0.24);\r\n            float reach = lerp(0.13, 0.39, variation) * lerp(0.75, 1.0, strength);\r\n            float pointRadius = originRadius \u002B lerp(0.065, 0.176, PeakParticleHash(key \u002B 2.17)) \u002B reach * expansion;\r\n            float direction = cell \u002B lerp(0.08, 0.92, PeakParticleHash(key \u002B 7.26));\r\n            direction \u002B= (variation - 0.5) * 0.23 * expansion;\r\n            float side = (angle - direction) * radius * radiansPerSector;\r\n            float delta = radius - pointRadius;\r\n            float trail = lerp(0.012, 0.046, variation) * lerp(1.0, 0.48, expansion);\r\n            float width = lerp(0.0007, 0.0021, variation);\r\n            float distance = length(float2(side, delta - clamp(delta, -trail, 0.0)));\r\n\r\n            [branch] if (visibility \u003E 0.001 \u0026\u0026 distance \u003C 0.018)\r\n            {\r\n                float core = 1.0 - smoothstep(width - pixel * 0.65, width \u002B pixel * 0.65, distance);\r\n                float head = 1.0 - smoothstep(width, width * 3.0 \u002B pixel, length(float2(side, delta)));\r\n                float bloom = (1.0 - smoothstep(width, 0.018, distance)) * 0.23;\r\n                float taper = smoothstep(-trail, -trail * 0.13, delta);\r\n                float alpha = saturate(visibility * (bloom \u002B max(core * (0.26 \u002B 0.65 * taper), head)));\r\n                float hue = PeakParticleHash(key \u002B 13.61);\r\n                float3 tint = hue \u003C 0.48 ? float3(0.26, 0.83, 1.0) : float3(1.0, 0.17, 0.55);\r\n                float3 color = lerp(tint, float3(1.0, 0.97, 1.0), head * 0.81);\r\n                result = float4(color * alpha, alpha) \u002B result * (1.0 - alpha);\r\n            }\r\n        }\r\n    }\r\n    return result;\r\n}\r\n\r\nfloat4 PeakParticles(float2 plane, float originRadius, float seconds, float peak, float amount, float seed)\r\n{\r\n    // A preset can also run with only the stock per-frame audio uniforms.\r\n    float clock = seconds * 3.7;\r\n    float phase = frac(clock);\r\n    return PeakParticleBurst(plane, originRadius, 0.025 \u002B phase * 0.43, peak, amount,\r\n        seed \u002B floor(clock) * 0.173);\r\n}\r\nTexture2D SpectrumData : register(t1);\nTexture2D SmokeData : register(t2);\nTexture2D ForegroundData : register(t3);\nfloat SpectrumAvailable;\nfloat SpectrumOpacity;\nfloat SmokeAvailable;\nfloat ForegroundAvailable;\nfloat PeakAvailable;\nfloat PeakAge;\nfloat PeakStrength;\nfloat PeakSerial;\n\nfloat4 NocturneOver(float4 bottom, float4 top)\n{\n    return top \u002B bottom * (1.0 - top.a);\n}\n\nfloat4 NocturneInk(float3 color, float alpha)\n{\n    alpha = saturate(alpha);\n    return float4(saturate(color) * alpha, alpha);\n}\n\nfloat NocturneChroma(float3 color)\n{\n    return max(color.r, max(color.g, color.b)) - min(color.r, min(color.g, color.b));\n}\n\nfloat NocturneLevel(int index)\n{\n    index = clamp(index, 0, 95);\n    [branch] if (SpectrumAvailable \u003E 0.5)\n    {\n        float magnitude = SpectrumData.Load(int3(index, 0, 0)).r * Macro16;\n        return saturate((20.0 * log10(max(0.00001, magnitude)) \u002B 54.0) / 51.0);\n    }\n    const float step = 0.86 / 96.0;\n    float x = 0.07 \u002B (float)index * step \u002B max(TexelSize.x, step * 0.54) * 0.5;\n    float3 peak = SourceTexture.SampleLevel(SourceSampler, float2(x, 0.57 - TexelSize.y * 1.4), 0).rgb;\n    return saturate((NocturneChroma(peak) / 0.65 - 0.25) / 0.75 * Macro16 / 2.9);\n}\n\nfloat NocturneBand(float u)\n{\n    float position = 3.0 \u002B saturate(u) * 83.0;\n    int index = (int)position;\n    return lerp(NocturneLevel(index), NocturneLevel(index \u002B 1), frac(position));\n}\n\nfloat4 NocturneRibbon(float2 p, float aa, float time, float middle, float impact, bool front)\n{\n    float left = front ? -0.63 : -0.55;\n    float right = front ? 0.59 : 0.66;\n    if (p.x \u003C left - aa || p.x \u003E right \u002B aa)\n        return 0.0;\n\n    float u = saturate((p.x - left) / (right - left));\n    float belly = sin(u * 3.14159265);\n    float body = front ? 0.088 \u002B belly * 0.178 - 0.26 * u * u * u\n                       : -0.12 - belly * 0.169 \u002B 0.222 * (1.0 - u) * (1.0 - u);\n    if (abs(p.y - body) \u003E 0.24)\n        return 0.0;\n\n    float band = NocturneBand(front ? u : 1.0 - u);\n    float crest = band * band;\n    float energy = lerp(middle, band, 0.65);\n    float bend = saturate(Macro06);\n    float axisSide = front ? 1.0 : -1.0;\n    float sweep = time * (front ? 0.92 : 0.71) \u002B u * (front ? 5.9 : 4.4) \u002B (front ? 0.2 : 2.8);\n    float fold = (0.020 \u002B 0.073 * band) * sin(sweep \u002B 1.37 * band);\n    float relief = 0.028 * saturate(AudioLow) \u002B crest * (0.030 \u002B 0.053 * impact) \u002B 0.046 * impact;\n    body \u002B= axisSide * belly * bend * (fold \u002B relief);\n    float twist = sin(sweep \u002B (front ? 1.1 : -0.8) \u002B 1.32 * crest \u002B 0.86 * impact) * saturate(Macro04);\n    float width = max(aa * 0.45, (front ? 0.081 : 0.063) * sqrt(max(0.0, belly))\n        * (0.68 \u002B 0.36 * abs(twist) \u002B 0.29 * energy \u002B 0.28 * impact) \u002B 0.029 * crest * belly * bend);\n    float across = p.y - body;\n    float side = clamp(across / width, -1.0, 1.0);\n    float fromEdge = width - abs(across);\n    float coverage = smoothstep(-aa, aa, min(fromEdge, min(p.x - left, right - p.x)));\n\n    float3 indigo = float3(0.070, 0.085, 0.225);\n    float3 petrol = float3(0.038, 0.245, 0.294);\n    float3 dusk = float3(0.272, 0.129, 0.335);\n    float3 silver = float3(0.57, 0.75, 0.82);\n    float3 gold = float3(0.92, 0.63, 0.39);\n    float colorPhase = smoothstep(0.13, 0.88, u);\n    float3 tint = front ? lerp(dusk, petrol, colorPhase) : lerp(petrol, dusk, colorPhase);\n    float curvature = sqrt(saturate(1.0 - side * side));\n    float polish = side * 0.79 \u002B 0.30 * twist;\n    float reflectionPosition = 0.34 \u002B 0.14 * sin(sweep - 1.9 * band);\n    float reflectedBand = exp2(-6.1 * (polish - reflectionPosition) * (polish - reflectionPosition));\n    float bevelPosition = -0.48 \u002B 0.21 * crest \u002B 0.10 * impact;\n    float narrow = exp2(-38.0 * (polish - bevelPosition) * (polish - bevelPosition));\n    float cap = smoothstep(0.03, 0.26, u) * (1.0 - smoothstep(0.76, 0.995, u));\n    float edgeLight = saturate(Macro05);\n    float grazing = pow(1.0 - curvature, 2.4);\n    float oil = 0.78 \u002B 0.22 * cos(side * 20.0 \u002B 3.1 * twist \u002B band * 1.7);\n    float3 face = indigo * (0.54 \u002B 0.29 * curvature) \u002B tint * (0.58 \u002B 0.46 * reflectedBand \u002B 0.33 * energy);\n    float spectralLight = edgeLight * (0.47 \u002B 0.42 * crest \u002B 0.38 * impact);\n    face \u002B= cap * oil * (silver * reflectedBand * (0.14 \u002B 0.48 * spectralLight)\n        \u002B gold * narrow * spectralLight * (front ? 0.66 : 0.32));\n    face \u002B= lerp(silver, gold, smoothstep(0.58, 0.96, u) * (front ? 0.18 : 0.82))\n        * grazing * (0.22 \u002B 0.34 * edgeLight);\n    float filament = exp2(-abs(fromEdge - aa * 0.38) / max(aa * 1.10, 0.00030));\n    face \u002B= lerp(silver, gold, (front ? 0.62 : 0.20) * smoothstep(0.18, 0.86, u))\n        * filament * edgeLight * 0.62;\n    float bloom = exp2(-89.0 * abs(fromEdge)) * belly * edgeLight * (0.095 \u002B 0.10 * energy \u002B 0.08 * impact);\n    return NocturneOver(NocturneInk(tint * 1.45, bloom), NocturneInk(face, coverage * (front ? 0.97 : 0.88)));\n}\n\nfloat4 NocturneGlass(float2 p, float scale, float aa, float middle, float time, float impact, float opacity)\n{\n    float2 sculpture = p / scale;\n    float bass = saturate(AudioLow * 1.5);\n    float perspective = saturate(Macro06) * (0.018 \u002B 0.055 * bass \u002B 0.048 * impact);\n    float yaw = sin(time * 0.84 \u002B 0.70 * bass);\n    float2 drift = perspective * float2(yaw * 0.59, cos(time * 0.68) * 0.28);\n    float2 rear = (sculpture \u002B drift \u002B float2(perspective * yaw * sculpture.y, 0.0)) / (1.0 - 0.29 * perspective);\n    float2 front = (sculpture - drift - float2(perspective * yaw * sculpture.y, 0.0)) / (1.0 \u002B 0.45 * perspective);\n    return NocturneOver(\n        NocturneRibbon(rear, aa / scale, time, middle, impact, false),\n        NocturneRibbon(front, aa / scale, time, middle, impact, true)) * opacity;\n}\n\nfloat4 NocturneTitle(float2 uv)\n{\n    [branch] if (ForegroundAvailable \u003E 0.5)\n        return ForegroundData.SampleLevel(SourceSampler, uv, 0);\n\n    float4 fallback = SampleSource(uv);\n    float neutral = 1.0 - smoothstep(0.12, 0.35, NocturneChroma(fallback.rgb));\n    float ink = smoothstep(0.46, 0.84, min(fallback.r, min(fallback.g, fallback.b))) * neutral;\n    return NocturneInk(fallback.rgb, fallback.a * ink);\n}\n\nfloat NocturneImpulse(float age, float level)\n{\n    if (age \u003C 0.0 || age \u003E 0.20)\n        return 0.0;\n    float attack = smoothstep(-0.014, 0.026, age);\n    float decay = 1.0 - smoothstep(0.038, 0.14, age);\n    float recoil = smoothstep(0.061, 0.091, age) * (1.0 - smoothstep(0.098, 0.19, age));\n    return (attack * decay - 0.27 * recoil) * level;\n}\n\nfloat2 NocturnePose(float2 p, float impulse, float2 direction)\n{\n    return (p - direction * impulse * saturate(Macro09) * 0.087) / (1.0 \u002B impulse * saturate(Macro10) * 0.102);\n}\n\nfloat4 Visualize(float2 uv)\n{\n    float2 plane = AspectUV(uv, TexelSize);\n    float aa = max(TexelSize.x, TexelSize.y) * 1.22;\n    float2 pixelPlane = TexelSize / max(TexelSize.x, TexelSize.y);\n    float scale = clamp(Macro15, 0.6, 1.4) * min(1.0, 0.72 / pixelPlane.x);\n    float middle = saturate(1.75 * AudioMid \u002B 0.42 * AudioHigh);\n    float altitude = (plane.y \u002B 0.12) * 1.34;\n    float lateral = plane.x - 0.22;\n    float wall = exp2(-4.9 * (altitude * altitude \u002B lateral * lateral));\n    float3 matte = float3(0.014, 0.017, 0.034) \u002B float3(0.039, 0.065, 0.072) * wall;\n    float mist = 0.0;\n    [branch] if (SmokeAvailable \u003E 0.5 \u0026\u0026 Macro02 \u003E 0.002)\n        mist = 1.0 - exp2(-1.82 * SmokeData.SampleLevel(SourceSampler, uv, 0).r * saturate(Macro02));\n    float atmosphere = mist * (0.16 \u002B 0.48 * wall);\n    float3 mistColor = lerp(float3(0.218, 0.147, 0.281), float3(0.132, 0.247, 0.266),\n        smoothstep(-0.43, 0.59, plane.x));\n    float4 scene = NocturneOver(NocturneInk(matte, Macro03), NocturneInk(mistColor, atmosphere));\n\n    float serial = PeakAvailable \u003E 0.5 ? PeakSerial : floor(Time * 3.7);\n    float age = PeakAvailable \u003E 0.5 ? PeakAge : frac(Time * 3.7) * 0.23;\n    float peak = PeakAvailable \u003E 0.5 ? PeakStrength : AudioBeat;\n    float eventLevel = smoothstep(0.15, 0.83, peak) * saturate(Macro07);\n    float angle = PeakParticleHash(float2(serial, Macro14)) * 6.2831853;\n    float2 direction = float2(cos(angle), 0.55 * sin(angle));\n    float impulse = NocturneImpulse(age, eventLevel);\n    float impact = saturate(1.3 * max(0.0, impulse) \u002B 0.24 * smoothstep(0.06, 0.68, AudioBeat));\n    float opacity = SpectrumAvailable \u003E 0.5 ? saturate(SpectrumOpacity) : 1.0;\n    float2 moving = NocturnePose(plane, impulse, direction);\n\n    // Embers read the live peak event in viewport coordinates, outside the optical shutter.\n    float emberLevel = smoothstep(0.32, 0.75, peak);\n    [branch] if (emberLevel \u003E 0.001 \u0026\u0026 Macro01 \u003E 0.002)\n    {\n        float4 embers = PeakParticleBurst(plane, 0.34 * scale, age, emberLevel, Macro01, Macro14 \u002B serial);\n        float warmth = smoothstep(-0.26, 0.26, plane.x \u002B 0.4 * plane.y);\n        embers.a = saturate(embers.a * 1.27);\n        float brightness = min(embers.a, 1.56 * max(embers.r, max(embers.g, embers.b)));\n        embers.rgb = brightness * lerp(float3(0.45, 0.78, 0.88), float3(1.0, 0.75, 0.46), warmth);\n        scene = NocturneOver(scene, embers * opacity);\n    }\n\n    float4 featured = NocturneGlass(moving, scale, aa, middle, Time, impact, opacity);\n    float shutter = 0.001 * Macro08 * saturate(Macro11);\n    [branch] if (shutter \u003E 0.001 \u0026\u0026 eventLevel \u003E 0.025 \u0026\u0026 age \u003C 0.20 \u002B shutter)\n    {\n        float previous = NocturneImpulse(age - shutter, eventLevel);\n        float halfway = NocturneImpulse(age - shutter * 0.5, eventLevel);\n        featured = (featured * 0.54 \u002B\n            NocturneGlass(NocturnePose(plane, halfway, direction), scale, aa, middle, Time - shutter * 0.5, impact, opacity) * 0.30 \u002B\n            NocturneGlass(NocturnePose(plane, previous, direction), scale, aa, middle, Time - shutter, impact, opacity) * 0.16);\n    }\n\n    float prism = abs(impulse) * saturate(Macro12) * 0.034;\n    [branch] if (prism \u003E aa * 0.35)\n    {\n        float4 warm = NocturneGlass(moving \u002B direction * prism, scale, aa, middle, Time, impact, opacity);\n        float4 cold = NocturneGlass(moving - direction * prism, scale, aa, middle, Time, impact, opacity);\n        featured = NocturneOver(featured, NocturneInk(float3(0.82, 0.44, 0.25), max(0.0, warm.a - featured.a) * 0.38));\n        featured = NocturneOver(featured, NocturneInk(float3(0.24, 0.58, 0.84), max(0.0, cold.a - featured.a) * 0.48));\n    }\n\n    featured.rgb = min(featured.a, featured.rgb * (1.0 \u002B 0.46 * impulse * saturate(Macro13)));\n    // Move the title with the same peak-triggered pose as the glass, then sample it once\n    // so narrow glyphs retain their edges during each shutter pass.\n    float2 titleUV = 0.5 \u002B moving * pixelPlane;\n    float4 title = all(titleUV \u003E= 0.0) \u0026\u0026 all(titleUV \u003C= 1.0) ? NocturneTitle(titleUV) : 0.0;\n    float4 composite = NocturneOver(NocturneOver(scene, featured), title);\n    return float4(composite.rgb / max(composite.a, 0.000001), composite.a);\n}",
      "slots": [
        {
          "number": 1,
          "label": "Peak embers",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.4,
          "isEffectLayer": true
        },
        {
          "number": 2,
          "label": "Live mist",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.58,
          "isEffectLayer": true
        },
        {
          "number": 3,
          "label": "Backdrop opacity",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 1,
          "isEffectLayer": false
        },
        {
          "number": 4,
          "label": "Ribbon twist",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.72,
          "isEffectLayer": false
        },
        {
          "number": 5,
          "label": "Edge light",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.68,
          "isEffectLayer": false
        },
        {
          "number": 6,
          "label": "Spectral bend",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.7,
          "isEffectLayer": false
        },
        {
          "number": 7,
          "label": "Impact strength",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.66,
          "isEffectLayer": false
        },
        {
          "number": 8,
          "label": "Shutter (ms)",
          "minimum": 14,
          "maximum": 80,
          "defaultValue": 0.35,
          "isEffectLayer": false
        },
        {
          "number": 9,
          "label": "Slide",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.46,
          "isEffectLayer": true
        },
        {
          "number": 10,
          "label": "Zoom",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.49,
          "isEffectLayer": true
        },
        {
          "number": 11,
          "label": "Motion blur",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.64,
          "isEffectLayer": true
        },
        {
          "number": 12,
          "label": "Prism split",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.42,
          "isEffectLayer": true
        },
        {
          "number": 13,
          "label": "Light snap",
          "minimum": 0,
          "maximum": 1,
          "defaultValue": 0.45,
          "isEffectLayer": true
        },
        {
          "number": 14,
          "label": "Motion seed",
          "minimum": 0,
          "maximum": 1000,
          "defaultValue": 0.164,
          "isEffectLayer": false
        },
        {
          "number": 15,
          "label": "Sculpture size",
          "minimum": 0.68,
          "maximum": 1.25,
          "defaultValue": 0.58,
          "isEffectLayer": false
        },
        {
          "number": 16,
          "label": "Spectrum gain",
          "minimum": 0.5,
          "maximum": 9,
          "defaultValue": 0.46,
          "isEffectLayer": false
        }
      ]
    },
    "audioKeys": {
      "bass": {
        "lowHz": 30,
        "highHz": 220,
        "mode": "Rms",
        "threshold": 0.01,
        "gain": 2.5,
        "attackSeconds": 0.012,
        "releaseSeconds": 0.11
      },
      "mid": {
        "lowHz": 220,
        "highHz": 2200,
        "mode": "Rms",
        "threshold": 0.01,
        "gain": 2.8,
        "attackSeconds": 0.012,
        "releaseSeconds": 0.11
      },
      "treble": {
        "lowHz": 2200,
        "highHz": 12000,
        "mode": "Rms",
        "threshold": 0.01,
        "gain": 4,
        "attackSeconds": 0.012,
        "releaseSeconds": 0.11
      },
      "beat": {
        "lowHz": 35,
        "highHz": 180,
        "mode": "Onset",
        "threshold": 0.018,
        "gain": 1.7,
        "attackSeconds": 0,
        "releaseSeconds": 0.15
      }
    },
    "layerBlend": "Normal",
    "windowBlend": "Normal",
    "previewQuality": "Full"
  }
}