Beams at the models' NATURAL width, per-weapon tube models (de-cartooned)

The "cartoonish" beams: the port drew the ermlaser tube INFLATED -- a 3.0x
glow + 0.9x core two-layer hack, 13x the authored radius.  Parsed the beam
models: ERMLASER/MLASER 0.22u radius, SLASER 0.11, LLASER 0.32, PPC 0.62 --
thin pencil beams with an authored per-class size progression; the PPC bolt
is genuinely ~3x fatter with its own 62-vert shape.

Now: ONE draw per beam at natural model scale (width multiplier 1.0), using
the weapon's OWN tube model (ermlaser for lasers, ppc.bgf for PPCs; the
s/m/llaser tubes load for other mechs' loadouts).  BTPushBeamKind carries the
model selector; BTPushBeam keeps its signature (kind 0).  Tint = 40+215x the
authored PipColor; the thin natural tubes stay under additive saturation so
the scrolling grit reads without a hand-dimmed core layer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-08 18:33:20 -05:00
co-authored by Claude Fable 5
parent 2036e7da51
commit 31626a3b97
2 changed files with 68 additions and 39 deletions
+15 -12
View File
@@ -2272,18 +2272,21 @@ void
if (r < 0.0f || g < 0.0f || b < 0.0f) { r = 0.78f; g = 0.08f; b = 0.02f; }
// PPC (classID 0xBD4 = 3028): a thicker, brighter bolt than a laser tube.
const int isPPC = ((int)em->GetClassID() == 3028);
unsigned glow =
(((unsigned)(r * 200.0f) & 0xFF) << 16) |
(((unsigned)(g * 200.0f) & 0xFF) << 8) |
((unsigned)(b * 200.0f) & 0xFF);
unsigned core =
(((unsigned)(96.0f + r * 96.0f) & 0xFF) << 16) |
(((unsigned)(96.0f + g * 96.0f) & 0xFF) << 8) |
((unsigned)(96.0f + b * 96.0f) & 0xFF);
BTPushBeam(mz.x, mz.y, mz.z, bend.x, bend.y, bend.z,
glow, ttl1, isPPC ? 4.4f : 3.0f); // wide glow (grit shows)
BTPushBeam(mz.x, mz.y, mz.z, bend.x, bend.y, bend.z,
core, ttl1, isPPC ? 1.5f : 0.9f); // thin bright core
// ONE draw per beam, at the model's NATURAL width: the weapon's
// own tube (ERMLASER radius 0.22u, PPC bolt 0.62u) IS the beam
// -- the old inflated two-layer glow/core (3.0x + 0.9x widths)
// drew fat cartoon cylinders 13x the authored size. The tint
// modulates the scrolling grit; thin natural tubes stay under
// saturation without a hand-dimmed core.
extern void BTPushBeamKind(float,float,float, float,float,float,
unsigned, float, float, int);
unsigned tint =
(((unsigned)(40.0f + r * 215.0f) & 0xFF) << 16) |
(((unsigned)(40.0f + g * 215.0f) & 0xFF) << 8) |
((unsigned)(40.0f + b * 215.0f) & 0xFF);
BTPushBeamKind(mz.x, mz.y, mz.z, bend.x, bend.y, bend.z,
tint, ttl1, 1.0f /* natural model width */,
isPPC ? 1 : 0 /* ppc.bgf : ermlaser.bgf */);
if (getenv("BT_BEAM_LOG") && (s_beamStateLog++ % 30) == 0)
DEBUG_STREAM << "[beam] " << (isPPC ? "PPC" : "laser") << " #" << wi
<< " mz=(" << mz.x << "," << mz.y << "," << mz.z