MengTo / Skills
webgl-laser
Create a fixed full-screen WebGL laser background effect with a thin white-hot vertical core, restrained brand-colored halo, and soft smoky fog around the beam. Use only for laser background effects, not full page layout, copy, generic hero scenes, particles, or unrelated motion systems.
Install
npx skills add https://github.com/MengTo/Skills --skill webgl-laserWebGL Laser
Scope
- Apply only to the laser background effect.
- Use a fixed full-screen canvas behind the DOM.
- Set
pointer-events: noneon the canvas. - Keep page content in a higher stacking context.
- Match the halo and smoke to the page's primary or strongest accent color.
Visual Target
- Thin vertical beam: crisp white-hot inner core, narrow colored halo.
- Atmospheric smoke: soft cloudy breakup concentrated around the beam.
- Dark cinematic field: restrained, brand-colored, and readable behind content.
- Slow pulse: glow breathes gently; no aggressive flicker or color cycling.
- Light blade feel: narrow and precise, never a thick neon pillar.
Layering
Brand Color
Use the product accent as the source color. The shader keeps the core near white and derives the halo/smoke from this color.
Raw WebGL Setup
Prefer raw WebGL with a full-screen quad unless the active file already uses another renderer.
Initializer
Keep u_resolution synced on resize and animate through u_time.
Tuning Knobs
- Beam position: adjust
xOffset; keep it in aspect-correct centered UV space. - Beam thickness: tune
coreWidthseparately fromglowWidth; keep the core extremely thin. - Color: derive
colorfrom the brand accent, then soften halo and smoke in shader. - Smoke density: tune
smokeDensity, FBM scale, drift speed, scatter width, and edge falloff. - Performance: reduce FBM octaves or cap
maxDprbefore changing the visual structure.
Taste Rules
- The hottest beam core stays near white.
- The halo and fog use the design's primary or strongest accent color.
- Smoke blooms near the beam and dissipates outward.
- Pulse affects glow only; avoid rapid flicker.
- Content readability wins over bloom, haze, or cinematic drama.
Avoid
- Hardcoding blue when the design uses another primary color.
- Making the beam thick enough to read as a glowing bar.
- Generic full-screen fog that is not concentrated around the beam.
- Turning the effect into a Three.js scene, particle explosion, or multicolor neon background.
- Letting the canvas intercept pointer events.
- Dense fog or extreme bloom that washes out foreground UI.