{
  "schemaVersion": 1,
  "id": "binary-stars",
  "version": "1.0.0",
  "status": "published",
  "kind": "object",
  "title": "Binary Stars",
  "summary": "Two stars in orbit, a stream of plasma pulled between them and spiralling into a glowing disc. Loops perfectly.",
  "description": "Two stars locked in orbit about their common centre: a large, cool, boiling orange giant and a small, hot blue companion wearing a spinning accretion disc, with a bright stream of plasma pulled across the gap and spiralling into the disc, against a field of distant stars. The surfaces churn with granulation and spots, the coronas flare, the disc swirls. Choose the star colours (classic, twin, ember or jade), how many orbits a loop holds, how much plasma flows, the disc and the seed.",
  "role": "Object (3D, three.js): a dramatic astronomy backdrop for science, sci-fi and music content.",
  "collections": [
    "backgrounds",
    "hypnotic-loops"
  ],
  "tags": [
    "binary star",
    "stars",
    "orbit",
    "plasma",
    "accretion disc",
    "space",
    "astronomy",
    "sci-fi",
    "loop",
    "3d"
  ],
  "synonyms": [
    "double star",
    "star system",
    "orbiting stars",
    "accretion disk",
    "stellar dance",
    "binary system"
  ],
  "useCases": [
    "A space, astronomy or physics explainer",
    "A sci-fi title scene or game intro",
    "A music-visualiser backdrop"
  ],
  "featured": null,
  "publishedAt": "2026-10-06",
  "implementation": {
    "target": "three",
    "runtime": "browser",
    "language": "javascript",
    "module": "esm",
    "entry": "src/binary-stars.js",
    "exports": [
      {
        "name": "createBinaryStars",
        "signature": "createBinaryStars({ palette?, orbits?, stream?, disc?, seed? }) => { group, setProgress(progress), dispose() }",
        "description": "The two stars, their coronas, the disc, the plasma stream and a star field as a group; render through createBloomPass."
      },
      {
        "name": "createBloomPass",
        "signature": "createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }",
        "description": "A small bloom with filmic tone mapping and an anti-aliased, depth-tested scene target."
      },
      {
        "name": "PALETTES",
        "signature": "PALETTES: { classic, twin, ember, jade }",
        "description": "Star colours (sRGB hex)."
      }
    ],
    "reusable": [
      "src/binary-stars.js"
    ],
    "demo": "demo.js",
    "harness": "index.html"
  },
  "dependencies": [
    {
      "id": "three",
      "version": "0.185.1",
      "reason": "Renderer, geometry and shader materials."
    },
    {
      "id": "apw-runtime",
      "version": "1.0.0",
      "scope": "demo",
      "reason": "Demo harness."
    }
  ],
  "params": [
    {
      "key": "palette",
      "label": "Stars",
      "type": "select",
      "default": "classic",
      "options": [
        {
          "value": "classic",
          "label": "Orange giant and blue dwarf"
        },
        {
          "value": "twin",
          "label": "Blue and violet twins"
        },
        {
          "value": "ember",
          "label": "Red and amber"
        },
        {
          "value": "jade",
          "label": "Green and cyan"
        }
      ]
    },
    {
      "key": "orbits",
      "label": "Orbits per loop",
      "type": "integer",
      "min": 1,
      "max": 3,
      "step": 1,
      "default": 1
    },
    {
      "key": "stream",
      "label": "Plasma",
      "type": "number",
      "min": 0,
      "max": 1.6,
      "step": 0.05,
      "default": 1
    },
    {
      "key": "disc",
      "label": "Accretion disc",
      "type": "number",
      "min": 0,
      "max": 1.5,
      "step": 0.5,
      "default": 1
    },
    {
      "key": "seed",
      "label": "Seed",
      "type": "integer",
      "min": 1,
      "max": 999,
      "step": 1,
      "default": 4
    }
  ],
  "presets": [
    {
      "id": "default",
      "label": "Orange giant and blue dwarf",
      "params": {}
    },
    {
      "id": "twin",
      "label": "Blue and violet twins",
      "params": {
        "palette": "twin",
        "seed": 8,
        "stream": 0.7
      }
    },
    {
      "id": "ember",
      "label": "Red and amber, fast",
      "params": {
        "palette": "ember",
        "orbits": 2,
        "stream": 1.4
      }
    },
    {
      "id": "jade",
      "label": "Green and cyan",
      "params": {
        "palette": "jade",
        "seed": 12
      }
    }
  ],
  "output": {
    "width": 1080,
    "height": 1080,
    "fps": 30,
    "durationSeconds": 16,
    "posterSeconds": 2,
    "alpha": false,
    "motion": "procedural",
    "loop": {
      "seamless": true,
      "cycleSeconds": 16,
      "method": "The pair goes a whole number of times round its orbit per loop, the plasma particles flow a whole number of times along the stream, the surface noise and the disc's spiral turn in whole turns, so the last frame meets the first."
    },
    "seed": {
      "param": "seed",
      "behavior": "Seed picks the stars' surface patterns and the distant star field: same seed, same system."
    }
  },
  "composition": {
    "inputs": "Time within the loop; the colours, orbits, plasma, disc and seed.",
    "outputs": "A full frame rendered in 3D through an anti-aliased bloom.",
    "coordinates": "The centre of mass is the origin; the giant (radius 1.15) orbits at 1.5 and the companion (0.62) at 3.1 in the xz plane; the camera looks down at about 22°.",
    "lighting": "Self-lit shaders; the bloom gives the coronas and the glare.",
    "timing": "setProgress(progress) places the stars, the plasma and the swirl; frames render in any order.",
    "compatibleWith": [
      "kinetic-title",
      "number-reveal"
    ],
    "notes": [
      "Granulation is three crossed lookups in a baked noise texture with offsets on circles; the disc is a polar swirl with spiral arms turning faster inside; the plasma is 900 points along a cubic Bezier with a helical spread."
    ]
  },
  "reuse": [
    "Astronomy explainer: Orange giant and blue dwarf.",
    "Sci-fi title: Red and amber, fast.",
    "Calm backdrop: Green and cyan."
  ],
  "integration": {
    "newProject": "Create a WebGLRenderer, createBinaryStars() and createBloomPass(renderer, { width, height }); each frame call stars.setProgress(progress) and bloom.render(scene, camera).",
    "existingProject": "Copy src/binary-stars.js; add stars.group to your scene and render it through createBloomPass."
  },
  "performance": {
    "notes": "Two lit spheres, two glow shells, a disc, 900 plasma points and a bloom with an anti-aliased target. A few milliseconds a frame on an integrated Intel GPU.",
    "limits": "Software WebGL renders in a second or two a frame."
  },
  "limitations": [
    "The orbit is a circle with a fixed mass ratio: no eccentricity, no tides, no real Roche lobe.",
    "The plasma is a particle stream along a curve, not a fluid simulation."
  ],
  "license": {
    "spdx": "MIT",
    "notice": "Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.",
    "thirdParty": []
  },
  "provenance": "Adapted from the owner's threejs-sketches/space-cosmic/binary-stars (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original scene: granulated star shaders, an additive accretion disc, a Bezier plasma stream and whole-turn motion for an exact loop.",
  "changelog": [
    {
      "version": "1.0.0",
      "date": "2026-10-05",
      "notes": "Initial release."
    }
  ]
}
