{
  "format": "xsf-plugin",
  "formatVersion": 1,
  "id": "you.neon-pulse",
  "name": "Neon Pulse",
  "version": "1.0.0",
  "author": "You",
  "icon": "💡",
  "description": "The plugin you build in the Shader Forge tutorial: a pulsing neon glow, stripes, a wobble and a matching theme.",
  "category": {
    "id": "neon",
    "label": "Neon Pulse",
    "icon": "💡"
  },
  "effects": [
    {
      "id": "neonPulse",
      "cat": "neon",
      "label": "Neon pulse",
      "desc": "Bands of glow that travel up the model.",
      "params": [
        {
          "id": "_NpColor",
          "label": "Glow color",
          "type": "color",
          "hdr": true,
          "def": [
            0.2,
            1,
            0.9,
            1
          ]
        },
        {
          "id": "_NpSpeed",
          "label": "Speed",
          "type": "range",
          "min": 0,
          "max": 10,
          "def": 3
        },
        {
          "id": "_NpBands",
          "label": "Bands",
          "type": "range",
          "min": 1,
          "max": 20,
          "def": 4
        },
        {
          "id": "_NpSharp",
          "label": "Sharpness",
          "type": "range",
          "min": 1,
          "max": 16,
          "def": 4
        },
        {
          "id": "_NpAmount",
          "label": "Amount",
          "type": "range",
          "min": 0,
          "max": 5,
          "def": 1.5
        }
      ],
      "emit": "float npW = 0.5 + 0.5 * sin(t * _NpSpeed - d.uv.w * _NpBands * 6.2831853);\nemit += _NpColor.rgb * pow(npW, _NpSharp) * _NpAmount;"
    },
    {
      "id": "neonStripes",
      "cat": "neon",
      "label": "Neon stripes",
      "desc": "Painted stripes across or along the model.",
      "params": [
        {
          "id": "_NsColor",
          "label": "Stripe color",
          "type": "color",
          "def": [
            1,
            0.2,
            0.8,
            1
          ]
        },
        {
          "id": "_NsCount",
          "label": "Count",
          "type": "range",
          "min": 1,
          "max": 40,
          "def": 10
        },
        {
          "id": "_NsDir",
          "label": "Direction",
          "type": "enum",
          "options": [
            [
              "Across",
              0
            ],
            [
              "Along",
              1
            ]
          ],
          "def": 0
        }
      ],
      "surface": {
        "switch": "_NsDir",
        "cases": [
          "float nsS = step(0.5, frac(d.uv.w * _NsCount));\ncol.rgb = lerp(col.rgb, _NsColor.rgb, nsS * _NsColor.a);",
          "float nsS = step(0.5, frac(d.uv.z * _NsCount));\ncol.rgb = lerp(col.rgb, _NsColor.rgb, nsS * _NsColor.a);"
        ]
      }
    },
    {
      "id": "neonWobble",
      "cat": "neon",
      "label": "Neon wobble",
      "desc": "The mesh gently wobbles to the beat.",
      "params": [
        {
          "id": "_NwAmount",
          "label": "Amount",
          "type": "range",
          "min": 0,
          "max": 0.2,
          "def": 0.03
        },
        {
          "id": "_NwSpeed",
          "label": "Speed",
          "type": "range",
          "min": 0,
          "max": 20,
          "def": 6
        }
      ],
      "vertex": "p += nrm * sin(t * _NwSpeed + p.y * 8.0) * _NwAmount;"
    }
  ],
  "presets": [
    {
      "name": "Neon club ball",
      "cat": "Neon Pulse",
      "config": {
        "name": "Neon/ClubBall",
        "lighting": "toon",
        "blend": "opaque",
        "features": {
          "neonPulse": true,
          "neonStripes": true
        },
        "values": {
          "_Color": [
            0.08,
            0.05,
            0.15,
            1
          ],
          "_NpColor": [
            1,
            0.3,
            0.9,
            1
          ],
          "_NsColor": [
            0.2,
            0.9,
            1,
            1
          ],
          "_NsCount": 16
        }
      }
    }
  ],
  "themes": [
    {
      "id": "neon-night",
      "name": "Neon Night",
      "dark": true,
      "vars": {
        "--bg": "#0d0b1a",
        "--panel": "#15122a",
        "--panel-2": "#1d1938",
        "--line": "#2d2752",
        "--text": "#f1ecff",
        "--muted": "#a79fd0",
        "--accent": "#ff4fd8"
      }
    }
  ],
  "script": "xsf.addCommand({ label: 'Neon: random glow color', icon: '💡', run() {\n  const c = xsf.getConfig();\n  c.values._NpColor = [Math.random() * 2, Math.random() * 2, Math.random() * 2, 1];\n  xsf.setConfig(c);\n  xsf.toast('New glow color!');\n} });"
}