DEKI/ENGINE 文档
手册 API 参考
deki-particles 0.40.1
Deki 包参考
deki-particles

模块化粒子系统:点/圆/矩形发射形状、重力、阻力、初速度,以及生命周期/大小/颜色/旋转修改器。

仓库:github.com/dekiengine/deki-particles · 最新版本:0.40.0 · 需要引擎 0.40.0 或更高版本 · 依赖:deki-nodegraph, deki-rendering, deki-2d

使用 DekiEditor --packages-add deki-particles <project> 或通过包管理器安装。引擎自身的组件和 C++ API 见 Deki 文档。

在编辑器中显示为 **Particles**。

组件

组件 类别 说明
ParticleEmitterComponent 粒子 按照粒子图资源生成并绘制粒子。

功能开关

可以从构建中去掉的部分。带有 define 的功能通过该 define 开关,其余的随其组件一起被剥离。

功能 define 默认值
Particle Emitter DEKI_FEATURE_PARTICLE_EMITTER 开

组件参考

ParticleEmitterComponent

按照粒子图资源生成并绘制粒子。

检视器中的名称:粒子发射器组件 · 类别:粒子 · 类型:DekiParticles::ParticleEmitterComponent

属性 类型 默认值 约束 说明
sprite AssetRef (Sprite) "" 为每个粒子绘制的图像。小而柔和的精灵可以掩盖设备所能承受的较少粒子数。
graph AssetRef (ParticleGraph) "" 粒子图资源,用于编写发射、速度以及随生命周期变化的大小和颜色。
maxParticles int32 64 0 到 4096 同时存活的粒子数上限。粒子池按此大小一次性分配,因此它既关乎视觉效果,也关乎内存。
playOnAwake bool true 对象一激活就开始发射。关闭时需要由其他东西来启动它。
looping bool true 效果结束时重新开始而不是停止。关闭时只播放一次便停止。
worldSpace bool true 发射器移动时,粒子留在其生成的位置。关闭时粒子随发射器一起移动,适合角色手持的火焰,而不适合角色身后留下的烟雾。
seed int32 0 0 到 2.14748e+09 随机种子。0 表示每次运行图案都不同;其他任何值每次都播放相同的图案,便于渲染测试进行比较。

从 RendererComponent 继承 sortingOrder, ignoreClip, pixelSnap, alphaMode。

更新日志

更新日志为英文。

0.40.0

Changed

  • minEngine 0.40.0: built against engine 0.40.0. A build of this package from before does not load and is rebuilt.

0.30.0

Changed

  • minEngine 0.30.0: built against engine 0.30.0. A build of this package from before does not load and is rebuilt.

Added

  • Particles carry their sprite's filter (QuadBlit::Source::filter), so a GPU draws them as the image's Filter says.
  • Particles carry their sprite's revision (QuadBlit::Source::revision), so a GPU drawing the 2D (deki-gl) uploads the sprite once, and the particle pass says it writes nothing into the frame buffer itself (RenderPass::WritesBuffer), so it costs nothing extra there.

更早的版本:CHANGELOG.md


由包的反射数据生成(引擎 0.40.1)。属性名就是场景文件中使用的键。重命名后会保留别名(兼容性)。