Skip to content

feat(particle): support continuous Birth sub-emitters - #3071

Open
hhhhkrx wants to merge 52 commits into
galacean:dev/2.0from
hhhhkrx:fix/particle-orbital-linear-order
Open

feat(particle): support continuous Birth sub-emitters#3071
hhhhkrx wants to merge 52 commits into
galacean:dev/2.0from
hhhhkrx:fix/particle-orbital-linear-order

Conversation

@hhhhkrx

@hhhhkrx hhhhkrx commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

背景

Birth 子发射器此前只在父粒子创建时固定发射一次,目标系统的发射率、距离发射、Burst 与延迟均未按父粒子独立运行。父粒子模拟又发生在 Renderer 准备渲染阶段,子发射结果会受到组件注册顺序和相机裁剪影响;同时父速度只保留了方向,无法表达绕轴、径向及其他模块共同形成的完整轨迹速度。

修改

  • 增加连续 Birth 系统模式,在父粒子整个存活期内逐父粒子运行目标 Emission,包括 Rate Over Time、Rate Over Distance、Burst、Start Delay、Loop 和 Duration。
  • 将 Emission 配置与运行游标分离,引入每个父粒子槽位和子发射槽独立持有的 EmissionRuntimeState,并在扩容、迁移、退休和清空时同步维护。
  • 复用 Transform Feedback 当前帧回读,同时为连续 Birth 与 Death 提供父粒子的当前世界位置。
  • 通过相邻采样位置差分计算父粒子完整世界速度,覆盖线性、绕轴、径向、力、重力、噪声以及发射器 Transform 位移。
  • 增加 InheritVelocityModule,保留 Initial、Current 模式以及完整 MinMaxCurve 配置;Initial 模式把父粒子轨迹速度按曲线系数叠加到子粒子初速度。
  • 增加场景级粒子系统调度器,按子发射依赖关系拓扑更新,并在相机裁剪前完成模拟和命令消费。
  • 调整绕轴、径向与线性速度的积分合成顺序,使连续子发射直接消费更新后的 TF 轨迹。

验证

  • 引擎模块构建通过。
  • engine-core 类型构建通过。
  • Particle SubEmitter、Velocity Over Lifetime、ParticleRenderer 与 Burst 定向测试通过。
  • 新增逐父粒子发射率、延迟、距离发射、Burst、槽位迁移、拓扑顺序、裁剪外更新以及完整轨迹速度测试。
  • 新增 HCFX 场景关注的绕轴 TF 位置与继承速度回归覆盖,并更新对应视觉基线。

Summary by CodeRabbit

  • New Features
    • Added particle velocity inheritance for sub-emitters (initial vs current parent velocity).
    • Introduced coordinated sub-emitter scheduling so chained emissions update in the correct order.
  • Bug Fixes
    • Improved sub-emitter Birth/Death timing, inherited properties, and transform-feedback position handling.
    • Fixed particle simulation/shader updates during instanced and partial-update passes, including preserved transform-feedback state.
  • Tests
    • Expanded sub-emitter and transform-feedback coverage, and added a WebGL2 test for velocityOverLifetime linear velocity integration.

Loading
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.

2 participants