Skip to content

Light glow & flare sync (target_light material toggles, light-style/pulse sync, sprite lighting refactor) - #902

Open
skies912 wants to merge 2 commits into
mainfrom
feature/light-glow-sync
Open

Light glow & flare sync (target_light material toggles, light-style/pulse sync, sprite lighting refactor)#902
skies912 wants to merge 2 commits into
mainfrom
feature/light-glow-sync

Conversation

@skies912

Copy link
Copy Markdown
Collaborator

Per-surface switchable and animated emissive glow stages + flares, driven by target_light entities and baked BSP lights, with no BSP format/version bump (reuses a spare surface bit).

What this adds

  • SURF_TOGGLE (0x2000) + toggle stage keyword (STAGE_TOGGLE) — a target_light switches a material's glow stages and flares on/off per-surface, bound by a material key on the light. quemap FaceCmp splits SURF_TOGGLE faces per brush side so panels sharing one material can chase independently.
  • Continuous brightness sync — glow stages and flares track a controlling light's brightness via toggle_alpha. A styled light makes them flicker/pulse; a target_light switches them (style × on/off). Bound to baked BSP lights (phase-correct style/drift) or target_light entities.
  • Pulse→light sync — a styleless light with a material key whose material has a pulse stage drives its own cast intensity from that pulse (e.g. jump pads breathing), using the same sine/clock/drift as the shader so the cast light and the glow stay phase-locked.
  • target_light extrasintensity key (matches point lights, via s.termination.y) and a back_and_forth spawnflag (teamed chases bounce instead of wrapping).
  • quemap warning when a SURF_TOGGLE face's material has no drawable/flare stage (catches mapper mistakes at compile).

Sprite lighting refactor

Replaces sprite_vs's bespoke distance-only lighting loop with a call to light.glsl::vertex_lighting via a local common_vertex_t, so particles get the full lighting model (ambient, occlusion, exposure, per-light diffuse, caustics) instead of flat distance attenuation. Billboards have no surface normal, so a camera-facing normal is synthesized for the lambert/sky terms. This also fixes dust/sprites staying flatly lit in shadowed corners — they're now properly grounded (net −10 lines in the shader path).

Compatibility

SURF_TOGGLE is a spare surface bit, so existing BSPs and the current release branch load unchanged and simply ignore the new entity keys.

Testing

Verified in-game (rage): per-surface glow + flare toggling, light-style sync on a flickering fluorescent, pulse→light on a jump pad, and grounded dust under the refactored sprite path. Perf under heavy particle scenes still wants more soak testing (the sprite path now does a few more per-vertex samples).

🤖 Generated with Claude Code

skies912 and others added 2 commits June 28, 2026 15:31
Per-surface switchable and animated emissive glow stages + flares, plus
light-driven extras, with no BSP format/version bump.

- SURF_TOGGLE (0x2000) + STAGE_TOGGLE `toggle` keyword: target_light switches
  a material's glow stages and flares on/off per-surface, bound by a `material`
  key on the light. quemap FaceCmp splits SURF_TOGGLE faces per brush side so
  panels sharing a material can chase independently.
- Continuous brightness: toggle_on -> toggle_alpha. Glow stages and flares now
  track a controlling light's brightness, so a styled `light` makes them flicker
  and a target_light switches them (style * on/off). Bound to baked BSP lights
  (phase-correct style/drift) or target_light entities.
- Pulse->light sync: a styleless `light` with a `material` key whose material has
  a `pulse` stage drives its own cast intensity from that pulse (jump pads), using
  the same sine/clock/drift as the shader so they stay phase-locked.
- target_light: `intensity` key (matches point lights, via s.termination.y) and
  `back_and_forth` spawnflag (teamed chase bounces instead of wrapping).
- quemap warning when a SURF_TOGGLE face's material has no drawable/flare stage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace sprite_vs's bespoke distance-only lighting loop with a call to
light.glsl::vertex_lighting using a local common_vertex_t, so particles
get the full model (ambient, occlusion, exposure, per-light diffuse,
caustics) instead of flat distance attenuation. Billboards have no
surface normal, so a camera-facing normal is synthesized for the lambert
and sky terms. Adds light.glsl to the sprite program and binds the
voxel occlusion/caustics + sky textures.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@skies912

Copy link
Copy Markdown
Collaborator Author

rage.zip
Didn't want to push this in update just yet. Has updated stuffs used in testing this feature branch (target_lights and light-pulse sync).

@skies912
skies912 requested a review from jdolan June 30, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant