Skip to content

[pull] master from beyond-all-reason:master - #96

Merged
pull[bot] merged 2 commits into
ExaDev:masterfrom
beyond-all-reason:master
Sep 11, 2026
Merged

[pull] master from beyond-all-reason:master#96
pull[bot] merged 2 commits into
ExaDev:masterfrom
beyond-all-reason:master

Conversation

@pull

@pull pull Bot commented Sep 11, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Ruwetuin and others added 2 commits September 10, 2026 20:24
…ed) (#3191)

* Nano Particles: add NanoParticleUpdate engine callin

Batched, unsynced lifecycle events for nano particles, so deferred-lighting
widgets can light them without polling. Nothing emits these yet; the standalone
nano particle effect added in the following commit owns the batching and the
sampling that decides which particles are reported.

Events are passed as one flat numeric array of 13-entry records rather than a
table per event, because a per-event table would dominate the cost of the callin
at the rates involved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Nano Particles: add standalone nano particle effect

Adds an optional nano particle effect that renders build spray as
shader-generated 3D shapes with an additive halo, behind NanoParticlesGL4
(default off). Ported from BAR's gfx_nano_particles_gl4 gadget.

The effect is not a projectile. Its particles have no projectile id, take no
part in collision or quadfield work, are never handed to Lua as projectiles, and
are not serialised; motion is analytic, so the shader reconstructs position from
start/velocity/frame and the CPU only touches a particle when it homes or has to
clear terrain. All of it lives in rts/Rendering/Env/NanoParticles:

  NanoParticleConfig  every tunable, in one place
  NanoParticleDefs    the PODs the other three share
  NanoParticleSystem  the particle store, homing, ground clamp, LuaUI batching
  NanoParticleEmitter how much spray a builder produces, and reclaim bursts
  NanoParticleRenderer shaders, buffers, culling, draw

Legacy nano spray is untouched. NanoProjectile, ProjectileDrawer and
NanoPieceCache have no diff at all; when the effect is off, or no shader path is
usable, emission falls through to CNanoProjectile exactly as before. The
simulation cannot tell the difference either way: a work tick still polls
QueryNanoPiece once and draws one synced RNG value, and everything the effect
adds runs off the unsynced RNG, as nano spray already did.

Beyond the shader look the effect also carries, each behind its own setting:

* emission proportional to buildSpeed * buildPower rather than one particle per
  work tick, so a builder's spray tracks the work it is doing instead of its
  nano piece count, spread round-robin over its pieces
* NanoParticlesHoming, particles following moving targets
* NanoParticlesGroundClamp, particles routed over intervening terrain
* NanoParticlesReclaimBurst, a burst when reclaiming a unit finishes, sized by
  metal cost and split across the builders that contributed
* NanoParticlesUpdateLuaUI, the batched callin added in the previous commit

The per-unit emission accumulators and the reclaim contributor tracking are
owned by the emitter rather than by CBuilder/CUnit: they are unsynced
presentation state, they must not be serialised, and no part of the sim needs to
know they exist. No sim class gains a member.

The renderer is heap-allocated behind a pointer, as the other GL-owning drawers
are. A VBO's constructor calls VBO::IsSupported(), which latches the GLAD
extension flags into function-local statics on its first call; constructing one
before GLAD has loaded latches them all to false and silently turns every VBO in
the process into a no-op.

Particles show on the minimap as the legacy ones do, reusing the vertex arrays
the world pass already filtered so it costs one walk and no visibility work, and
filling the shared projectile minimap buffer rather than adding a draw of its
own.

The spawn gate is the effect's own rather than the legacy proportional one,
which throttles from the first particle and so makes emission approach the
budget asymptotically instead of scaling with NanoParticlesRate.

Tunables are named and documented in NanoParticleConfig.h instead of being
literals spread through the sources. The visual subset reaches both shader paths
as uniforms, so the geometry and instanced renderers cannot drift apart.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Nano Particles: changelog for the standalone effect

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* added `Engine.FeatureSupport.nanoParticlesGL4` boolean, so games can detect that the engine has the standalone nano particle effect and retire their own Lua implementation of it.

* moved changelog to: doc\pr-changelogs\3191.md

* Nano Particles: added configbool: NanoParticlesTargetLostFade

"Nano particles fade out and shrink when the unit they were aimed at is destroyed, cancelled, or finished, instead of flying on into nothing"

(ported over this feature from the gadget as well)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…n modifiers (#3336)

* apply terrain speed mod to max speed for drag calculations
@pull pull Bot locked and limited conversation to collaborators Sep 11, 2026
@pull pull Bot added the ⤵️ pull label Sep 11, 2026
@pull
pull Bot merged commit a88e260 into ExaDev:master Sep 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants