godot-particles by thedivergentai/gd-agentic-skills
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-particlesGPU 加速渲染、基于材质的配置和子发射器共同定义了高性能的视觉特效。
用于高级粒子视觉特效的专业自定义着色器集成。
具有自动清理功能的一次性粒子爆发——视觉特效系统的核心。
专业的程序化粒子运动逻辑。演示了用于动态风/轨道效果的持久性 CUSTOM 数据和 USERDATA 注入。
高性能碰撞处理。使用 emit_subparticle() 和 COLLISION_NORMAL 触发子发射器(飞溅/碎片)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用 cull_mask 来隔离粒子与吸引器交互的优化模式,防止全局性能瓶颈。
绕过 GPUParticles 处理数百万实体(鱼群、昆虫群)。使用 set_buffer_interpolated() 实现无抖动的高数量运动。
通过 USERDATA 将运行时变量传递给粒子着色器的清晰架构模式,以保持 GPU 批处理。
在局部空间(光环)和全局空间(轨迹)之间切换的专业逻辑。包含用于传送的正确 restart() 处理。
使用 finished 信号和 restart() 进行稳健的生命周期管理,以避免异步发射失败。
使用与摄像机对齐的 GPUParticlesCollisionHeightField3D 来优化全局天气效果(雨/雪)。
用于环境视觉特效的分层细节层次。使用 visibility_range 和边距来完全剔除远处的火炬或火焰。
针对 2D 粒子卡顿的专业解决方案。切换到使用 fract_delta 的 CPUParticles2D,以实现平滑的物理父级运动。
amount_ratio 来动态优化性能 —— 它不会节省 GPU 内存或改善处理;完整的 amount 仍然会被分配。请直接更改 amount 属性。preprocess 设置为极高的值 —— 高值(例如 60 秒)会强制 GPU 在单个渲染帧中模拟数千帧,可能导致 GPU 立即崩溃。visibility_aabb —— 错误的 AABB 会导致视锥体剔除错误(粒子突然消失)并破坏 LOD 计算。请使用编辑器工具栏生成 AABB。queue_free() —— 使用 finished 信号而不是任意的 Timer 来进行安全的生命周期管理。local_coords = true —— 抛射物留下的烟雾或火焰必须使用全局空间(local_coords = false),否则轨迹会像一根僵硬的棍子一样跟随抛射物。fract_delta = true 的 CPUParticles2D。finished 信号后立即触发 emitting = true —— 异步 GPU 状态延迟可能导致重启失败。请改用 restart() 方法。EMISSION_SHAPE_POINT —— 在单个点生成所有粒子看起来很扁平。使用球体或盒子形状来实现自然的 3D 扩散。emitting = false —— 这可以防止在你通过脚本定位节点之前,在场景原点处产生不需要的发射。# 添加 GPUParticles2D 节点
# 设置数量: 32
# 设置生命周期: 1.0
# 设置一次性: true (用于爆炸)
# 创建 ParticleProcessMaterial
var material := ParticleProcessMaterial.new()
# 发射形状
material.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_SPHERE
material.emission_sphere_radius = 10.0
# 重力
material.gravity = Vector3(0, 98, 0)
# 速度
material.initial_velocity_min = 50.0
material.initial_velocity_max = 100.0
# 颜色
material.color = Color.ORANGE_RED
# 应用到 godot-particles
$GPUParticles2D.process_material = material
extends GPUParticles2D
func _ready() -> void:
one_shot = true
amount = 64
lifetime = 0.8
explosiveness = 0.9
var mat := ParticleProcessMaterial.new()
mat.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_SPHERE
mat.emission_sphere_radius = 5.0
mat.initial_velocity_min = 100.0
mat.initial_velocity_max = 200.0
mat.gravity = Vector3(0, 200, 0)
mat.scale_min = 0.5
mat.scale_max = 1.5
process_material = mat
emitting = true
extends GPUParticles2D
func _ready() -> void:
amount = 16
lifetime = 2.0
var mat := ParticleProcessMaterial.new()
mat.direction = Vector3(0, -1, 0)
mat.initial_velocity_min = 20.0
mat.initial_velocity_max = 40.0
mat.scale_min = 0.5
mat.scale_max = 1.0
mat.color = Color(0.5, 0.5, 0.5, 0.5)
process_material = mat
var mat := ParticleProcessMaterial.new()
mat.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_BOX
mat.emission_box_extents = Vector3(100, 100, 0)
mat.gravity = Vector3.ZERO
mat.angular_velocity_min = -180
mat.angular_velocity_max = 180
mat.scale_min = 0.1
mat.scale_max = 0.5
# 使用星星纹理
$GPUParticles2D.texture = load("res://textures/star.png")
$GPUParticles2D.process_material = mat
# player.gd
const EXPLOSION_EFFECT := preload("res://effects/explosion.tscn")
func die() -> void:
var explosion := EXPLOSION_EFFECT.instantiate()
get_parent().add_child(explosion)
explosion.global_position = global_position
explosion.emitting = true
queue_free()
extends GPUParticles3D
func _ready() -> void:
amount = 100
lifetime = 3.0
var mat := ParticleProcessMaterial.new()
mat.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_BOX
mat.emission_box_extents = Vector3(10, 0.1, 10)
mat.direction = Vector3.UP
mat.initial_velocity_min = 2.0
mat.initial_velocity_max = 5.0
mat.gravity = Vector3(0, -9.8, 0)
process_material = mat
var mat := ParticleProcessMaterial.new()
# 创建渐变
var gradient := Gradient.new()
gradient.add_point(0.0, Color.YELLOW)
gradient.add_point(0.5, Color.ORANGE)
gradient.add_point(1.0, Color(0.5, 0.0, 0.0, 0.0)) # 淡出到透明红色
var gradient_texture := GradientTexture1D.new()
gradient_texture.gradient = gradient
mat.color_ramp = gradient_texture
# 生成 godot-particles 的粒子(烟花)
$ParentParticles.sub_emitter = $ChildParticles.get_path()
$ParentParticles.sub_emitter_mode = GPUParticles2D.SUB_EMITTER_AT_END
# 为 godot-particles 添加纹理
$GPUParticles2D.texture = load("res://textures/particle.png")
# 自动删除一次性 godot-particles
if one_shot:
await get_tree().create_timer(lifetime).timeout
queue_free()
# 为移动端减少数量
if OS.get_name() == "Android":
amount = amount / 2
每周安装量
105
仓库
GitHub 星标数
59
首次出现
2026 年 2 月 10 日
安全审计
安装于
gemini-cli104
opencode103
codex103
github-copilot100
kimi-cli99
amp99
GPU-accelerated rendering, material-based configuration, and sub-emitters define performant VFX.
Expert custom shader integration for advanced particle VFX.
One-shot particle bursts with auto-cleanup - essential for VFX systems.
Expert procedural particle movement logic. Demonstrates persistent CUSTOM data and USERDATA injection for dynamic wind/orbit effects.
High-performance collision handling. Triggers sub-emitters (splashes/debris) using emit_subparticle() and COLLISION_NORMAL.
Optimization pattern using cull_mask to isolate particle-attractor interactions, preventing global performance bottlenecks.
Bypassing GPUParticles for millions of entities (fish, insects). Uses set_buffer_interpolated() for jitter-free high-count movement.
Clean architectual pattern for passing runtime variables to particle shaders via USERDATA to preserve GPU batching.
Expert logic for switching between localized (Auras) and global (Trails) space. Includes correct restart() handling for teleports.
Robust lifecycle management using the finished signal and restart() to avoid async emission failures.
Optimizing global weather (Rain/Snow) using Camera-snapped GPUParticlesCollisionHeightField3D.
Hierarchical LOD for environmental VFX. Uses visibility_range and margins to cull distant torches or fires completely.
Expert workaround for 2D particle stuttering. Switches to CPUParticles2D with fract_delta for smooth physics-parented movement.
amount_ratio to optimize performance dynamically — It does not save GPU memory or improve processing; the full amount is still allocated. Change the amount property directly instead.preprocess to extremely high values — High values (e.g., 60s) will force the GPU to simulate thousands of frames in a single render tick, potentially causing an immediate GPU crash.visibility_aabb unconfigured for large systems — Incorrect AABBs cause frustum culling errors (particles popping out) and break LOD calculations. Generate AABBs using the editor toolbar.queue_free() one-shot particles — Use the signal instead of an arbitrary Timer for safe lifecycle management.# Add GPUParticles2D node
# Set Amount: 32
# Set Lifetime: 1.0
# Set One Shot: true (for explosions)
# Create ParticleProcessMaterial
var material := ParticleProcessMaterial.new()
# Emission shape
material.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_SPHERE
material.emission_sphere_radius = 10.0
# Gravity
material.gravity = Vector3(0, 98, 0)
# Velocity
material.initial_velocity_min = 50.0
material.initial_velocity_max = 100.0
# Color
material.color = Color.ORANGE_RED
# Apply to godot-particles
$GPUParticles2D.process_material = material
extends GPUParticles2D
func _ready() -> void:
one_shot = true
amount = 64
lifetime = 0.8
explosiveness = 0.9
var mat := ParticleProcessMaterial.new()
mat.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_SPHERE
mat.emission_sphere_radius = 5.0
mat.initial_velocity_min = 100.0
mat.initial_velocity_max = 200.0
mat.gravity = Vector3(0, 200, 0)
mat.scale_min = 0.5
mat.scale_max = 1.5
process_material = mat
emitting = true
extends GPUParticles2D
func _ready() -> void:
amount = 16
lifetime = 2.0
var mat := ParticleProcessMaterial.new()
mat.direction = Vector3(0, -1, 0)
mat.initial_velocity_min = 20.0
mat.initial_velocity_max = 40.0
mat.scale_min = 0.5
mat.scale_max = 1.0
mat.color = Color(0.5, 0.5, 0.5, 0.5)
process_material = mat
var mat := ParticleProcessMaterial.new()
mat.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_BOX
mat.emission_box_extents = Vector3(100, 100, 0)
mat.gravity = Vector3.ZERO
mat.angular_velocity_min = -180
mat.angular_velocity_max = 180
mat.scale_min = 0.1
mat.scale_max = 0.5
# Use star texture
$GPUParticles2D.texture = load("res://textures/star.png")
$GPUParticles2D.process_material = mat
# player.gd
const EXPLOSION_EFFECT := preload("res://effects/explosion.tscn")
func die() -> void:
var explosion := EXPLOSION_EFFECT.instantiate()
get_parent().add_child(explosion)
explosion.global_position = global_position
explosion.emitting = true
queue_free()
extends GPUParticles3D
func _ready() -> void:
amount = 100
lifetime = 3.0
var mat := ParticleProcessMaterial.new()
mat.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_BOX
mat.emission_box_extents = Vector3(10, 0.1, 10)
mat.direction = Vector3.UP
mat.initial_velocity_min = 2.0
mat.initial_velocity_max = 5.0
mat.gravity = Vector3(0, -9.8, 0)
process_material = mat
var mat := ParticleProcessMaterial.new()
# Create gradient
var gradient := Gradient.new()
gradient.add_point(0.0, Color.YELLOW)
gradient.add_point(0.5, Color.ORANGE)
gradient.add_point(1.0, Color(0.5, 0.0, 0.0, 0.0)) # Fade to transparent red
var gradient_texture := GradientTexture1D.new()
gradient_texture.gradient = gradient
mat.color_ramp = gradient_texture
# Particles that spawn godot-particles (fireworks)
$ParentParticles.sub_emitter = $ChildParticles.get_path()
$ParentParticles.sub_emitter_mode = GPUParticles2D.SUB_EMITTER_AT_END
# Add texture to godot-particles
$GPUParticles2D.texture = load("res://textures/particle.png")
# Auto-delete one-shot godot-particles
if one_shot:
await get_tree().create_timer(lifetime).timeout
queue_free()
# Reduce amount for mobile
if OS.get_name() == "Android":
amount = amount / 2
Weekly Installs
105
Repository
GitHub Stars
59
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli104
opencode103
codex103
github-copilot100
kimi-cli99
amp99
ESLint迁移到Oxlint完整指南:JavaScript/TypeScript项目性能优化工具
1,600 周安装
代码架构文档生成工具 - 自动分析代码库并生成技术文档
104 周安装
Clawtributor:AI代理安全报告工具,开源社区威胁情报贡献平台
104 周安装
ripgrep (rg) 快速文本搜索工具:比 grep 快 100 倍的正则表达式搜索
104 周安装
Python PDF处理指南:合并、拆分、提取文本与表格,创建PDF文件
104 周安装
Shopify Polaris Web Components 使用指南:为 App Home 构建 UI 的完整教程
104 周安装
每日新闻摘要生成器 - AI自动汇总多源新闻,智能生成Markdown报告
104 周安装
finishedlocal_coords = true for trails — Smoke or fire left behind by a projectile MUST use global space (local_coords = false) or the trail will follow the projectile like a stiff stick.CPUParticles2D with fract_delta = true for high-speed 2D movement.emitting = true immediately after a finished signal — Async GPU state delays can cause the restart to fail. Use the restart() method instead.EMISSION_SHAPE_POINT for volumentric explosions — Spawning all particles at a single point looks flat. Use a Sphere or Box shape for natural 3D spread.emitting = false initially for one-shot VFX — This prevents unwanted emission at the scene origin before you've had a chance to position the node via script.