summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp3
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp7
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 9d0fb462f4..50dc4f5bf2 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1679,6 +1679,9 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
RasterizerStorageGLES3::Particles *particles = static_cast<RasterizerStorageGLES3::Particles *>(e->owner);
RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface *>(e->geometry);
+ if (!particles->emitting && particles->inactive)
+ break;
+
if (!particles->use_local_coords) //not using local coordinates? then clear transform..
state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, Transform());
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index eb25d6c7a1..f201673a2b 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -5574,6 +5574,13 @@ bool RasterizerStorageGLES3::particles_get_emitting(RID p_particles) {
return particles->emitting;
}
+bool RasterizerStorageGLES3::particles_get_inactive(RID p_particles) {
+ Particles *particles = particles_owner.getornull(p_particles);
+ ERR_FAIL_COND_V(!particles, false);
+
+ return particles->inactive;
+}
+
void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount) {
Particles *particles = particles_owner.getornull(p_particles);
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index 80df21941b..e3cfe6d457 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -1224,6 +1224,7 @@ public:
virtual void particles_set_emitting(RID p_particles, bool p_emitting);
virtual bool particles_get_emitting(RID p_particles);
+ virtual bool particles_get_inactive(RID p_particles);
virtual void particles_set_amount(RID p_particles, int p_amount);
virtual void particles_set_lifetime(RID p_particles, float p_lifetime);
virtual void particles_set_one_shot(RID p_particles, bool p_one_shot);