Light glow & flare sync (target_light material toggles, light-style/pulse sync, sprite lighting refactor) - #902
Open
skies912 wants to merge 2 commits into
Open
Light glow & flare sync (target_light material toggles, light-style/pulse sync, sprite lighting refactor)#902skies912 wants to merge 2 commits into
skies912 wants to merge 2 commits into
Conversation
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>
Collaborator
Author
|
rage.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-surface switchable and animated emissive glow stages + flares, driven by
target_lightentities and baked BSP lights, with no BSP format/version bump (reuses a spare surface bit).What this adds
SURF_TOGGLE(0x2000) +togglestage keyword (STAGE_TOGGLE) — atarget_lightswitches a material's glow stages and flares on/off per-surface, bound by amaterialkey on the light. quemapFaceCmpsplitsSURF_TOGGLEfaces per brush side so panels sharing one material can chase independently.toggle_alpha. A styledlightmakes them flicker/pulse; atarget_lightswitches them (style × on/off). Bound to baked BSP lights (phase-correct style/drift) ortarget_lightentities.lightwith amaterialkey whose material has apulsestage 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_lightextras —intensitykey (matches point lights, vias.termination.y) and aback_and_forthspawnflag (teamed chases bounce instead of wrapping).SURF_TOGGLEface'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 tolight.glsl::vertex_lightingvia a localcommon_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_TOGGLEis 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