|
@@ -1415,6 +1415,7 @@ void ParticlesStorage::update_particles() {
|
|
|
}
|
|
|
|
|
|
bool zero_time_scale = Engine::get_singleton()->get_time_scale() <= 0.0;
|
|
|
+ bool updated = false;
|
|
|
|
|
|
if (particles->clear && particles->pre_process_time > 0.0) {
|
|
|
double frame_time;
|
|
@@ -1429,6 +1430,7 @@ void ParticlesStorage::update_particles() {
|
|
|
while (todo >= 0) {
|
|
|
_particles_process(particles, frame_time);
|
|
|
todo -= frame_time;
|
|
|
+ updated = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1450,9 +1452,10 @@ void ParticlesStorage::update_particles() {
|
|
|
}
|
|
|
double todo = particles->frame_remainder + delta;
|
|
|
|
|
|
- while (todo >= frame_time) {
|
|
|
+ while (todo >= frame_time || (particles->clear && !updated)) {
|
|
|
_particles_process(particles, frame_time);
|
|
|
todo -= decr;
|
|
|
+ updated = true;
|
|
|
}
|
|
|
|
|
|
particles->frame_remainder = todo;
|
|
@@ -1460,14 +1463,16 @@ void ParticlesStorage::update_particles() {
|
|
|
} else {
|
|
|
if (zero_time_scale) {
|
|
|
_particles_process(particles, 0.0);
|
|
|
+ updated = true;
|
|
|
} else {
|
|
|
_particles_process(particles, RendererCompositorRD::singleton->get_frame_delta_time());
|
|
|
+ updated = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//copy particles to instance buffer
|
|
|
|
|
|
- if (particles->draw_order != RS::PARTICLES_DRAW_ORDER_VIEW_DEPTH && particles->transform_align != RS::PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD && particles->transform_align != RS::PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY) {
|
|
|
+ if (updated && particles->draw_order != RS::PARTICLES_DRAW_ORDER_VIEW_DEPTH && particles->transform_align != RS::PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD && particles->transform_align != RS::PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY) {
|
|
|
//does not need view dependent operation, do copy here
|
|
|
ParticlesShader::CopyPushConstant copy_push_constant;
|
|
|
|