算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
webgl-particle-galaxy【设计与创意】A real-time particle galaxy — tens of thousands of additive-blended GPU points spiraling around a bright core, their orbits solved entirely in the vertex shader (from gl_VertexID), so the whole cloud draws in one call. Rendered as a single self-contained `index.html`. Use when the brief asks for a "particle field", "particle galaxy", "point cloud", "…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: webgl-particle-galaxy
description: |
A real-time particle galaxy — tens of thousands of additive-blended GPU
points spiraling around a bright core, their orbits solved entirely in the
vertex shader (from gl_VertexID), so the whole cloud draws in one call.
Rendered as a single self-contained index.html. Use when the brief asks
for a "particle field", "particle galaxy", "point cloud", "instanced
points", "starfield", "GPU particles", or a swirling generative point
system. OpenDesign serves this in powered-preview mode so the GPU stack
actually runs.
triggers:
Produce a single self-contained index.html that renders a real-time particle system full-screen, with a clean typographic overlay on top. The signature move: compute each particle's position on the GPU so the CPU never loops over particles.
OpenDesign detects getContext('webgl2') and renders this file in powered preview — a cross-origin-isolated iframe with allow-same-origin. The full GPU pipeline is available; you do not need to work around the opaque sandbox.
webgl-particle-galaxy/
├── SKILL.md ← you're reading this
└── example.html ← a working 50,000-point WebGL2 galaxy (READ FIRST)
Read example.html end to end. Note the shape: no vertex buffer — the vertex shader reads gl_VertexID, hashes it into a stable per-particle seed, and derives a log-spiral orbit with an inner-fast rotation curve. Points are drawn with gl.drawArrays(gl.POINTS, 0, N) in one call, additive-blended (blendFunc(ONE, ONE) with premultiplied color) so overlapping points glow.
Choose a field the vertex shader can express cheaply from gl_VertexID + uTime:
speed ≈ k / (r + ε), thin disk.index.htmlgl_PointSize), clamped and DPR-aware; soft round sprites via gl_PointCoord + a gaussian falloff in the fragment shader.blendFunc(ONE, ONE) reads as glow, not double-exposure.getShaderInfoLog / getProgramInfoLog) so a typo fails loudly.#63fe13 for the arms and a white-blue core).webgl2 is unavailable.