Explore: detect laser-like mesh heuristically and render it as a shader-driven beam (medium scattering + line light) #1284

Open
opened 2026-10-29 05:54:39 +00:00 by sky_line · 0 comments
Owner

Explore detecting laser-like mesh in-world (club lasers, beam effects) and drawing it as a shader-driven beam instead of as plain geometry.

Why:

  • Looks: mesh lasers are flat, textured strips. A shader beam can scatter in the haze / volumetric fog medium (#1266) with a proper falloff. It looks the same from every angle (no paper-thin strip when viewed edge-on) and blooms correctly.
  • Cost: long, thin emissive triangles are the worst case for the emissive light build (the long-triangle reach cliff we just hit), and they churn RT geometry. A beam can be one analytic line light with a bounded cost per beam.

Heuristic detection (first pass, all on data we already have):

  • Shape: a very high length-to-width ratio (a strip, cylinder or cone), small cross-section, long extent.
  • Material: fullbright and/or glow, alpha-blended or additive-looking, often with texture animation (scrolling), bright saturated colour.
  • Behaviour: often rotated or moved by script, often in sets.
  • Keep a confidence score. Convert only above a threshold; everything else draws as normal. Never convert attachments or HUDs.

Rendering (to explore):

  • A beam primitive per detected object, aligned to the mesh's long axis, using its colour, texture animation phase and alpha as inputs.
  • Single scattering through the existing participating medium (haze / fog density), plus a soft core, a glow falloff and an end fade.
  • One analytic line light per beam for direct lighting (bounded), replacing the object's emissive-triangle records.
  • Fixed budget: at most N beams per frame, ranked by screen coverage and brightness. Above the budget, objects draw as normal.

Rules:

  • Experimental, A/B-able (Persist=0) until it proves itself.
  • It must never make a laser invisible or move it: the beam follows the object's transform every frame.
  • No per-object fallback zoo. Detected means beam; otherwise normal draw.
  • Fixed cost; no unbounded lists.

Open questions: how often false positives hit (thin glowing trim, neon tubes, poles). Whether neon tubes should get the same treatment as short capsule lights. Interaction with the emissive fixed-budget rewrite and GI emitter invalidation.

Explore detecting laser-like mesh in-world (club lasers, beam effects) and drawing it as a shader-driven beam instead of as plain geometry. **Why:** - **Looks:** mesh lasers are flat, textured strips. A shader beam can scatter in the haze / volumetric fog medium (#1266) with a proper falloff. It looks the same from every angle (no paper-thin strip when viewed edge-on) and blooms correctly. - **Cost:** long, thin emissive triangles are the worst case for the emissive light build (the long-triangle reach cliff we just hit), and they churn RT geometry. A beam can be one analytic line light with a bounded cost per beam. **Heuristic detection (first pass, all on data we already have):** - Shape: a very high length-to-width ratio (a strip, cylinder or cone), small cross-section, long extent. - Material: fullbright and/or glow, alpha-blended or additive-looking, often with texture animation (scrolling), bright saturated colour. - Behaviour: often rotated or moved by script, often in sets. - Keep a confidence score. Convert only above a threshold; everything else draws as normal. Never convert attachments or HUDs. **Rendering (to explore):** - A beam primitive per detected object, aligned to the mesh's long axis, using its colour, texture animation phase and alpha as inputs. - Single scattering through the existing participating medium (haze / fog density), plus a soft core, a glow falloff and an end fade. - One analytic line light per beam for direct lighting (bounded), replacing the object's emissive-triangle records. - Fixed budget: at most N beams per frame, ranked by screen coverage and brightness. Above the budget, objects draw as normal. **Rules:** - Experimental, A/B-able (Persist=0) until it proves itself. - It must never make a laser invisible or move it: the beam follows the object's transform every frame. - No per-object fallback zoo. Detected means beam; otherwise normal draw. - Fixed cost; no unbounded lists. **Open questions:** how often false positives hit (thin glowing trim, neon tubes, poles). Whether neon tubes should get the same treatment as short capsule lights. Interaction with the emissive fixed-budget rewrite and GI emitter invalidation.
sky_line added this to the Slipstream project 2026-10-29 05:54:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#1284
No description provided.