diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-11-19 20:34:29 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-11-19 20:34:29 -0300 |
commit | d30422800302d024499d5f895b2fbf598fe21a5a (patch) | |
tree | d7a9961781149420856b21e8a612739199befbf4 /servers/visual | |
parent | 55ded6b2dec1ce1e36b20537eb55d73b5d98063c (diff) |
Do not draw particles if they are not processing at all, fixes #19507
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.h | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index f9beeb226c..4329203ccb 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -518,6 +518,8 @@ public: virtual void particles_set_fractional_delta(RID p_particles, bool p_enable) = 0; virtual void particles_restart(RID p_particles) = 0; + virtual bool particles_is_inactive(RID p_particles) const = 0; + virtual void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) = 0; virtual void particles_set_draw_passes(RID p_particles, int p_count) = 0; diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 13de92f226..1deca7bc66 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -1912,9 +1912,14 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca if (ins->base_type == VS::INSTANCE_PARTICLES) { //particles visible? process them - VSG::storage->particles_request_process(ins->base); - //particles visible? request redraw - VisualServerRaster::redraw_request(); + if (VSG::storage->particles_is_inactive(ins->base)) { + //but if nothing is going on, don't do it. + keep = false; + } else { + VSG::storage->particles_request_process(ins->base); + //particles visible? request redraw + VisualServerRaster::redraw_request(); + } } if (geom->lighting_dirty) { |