summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-03 00:32:20 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-03 00:32:20 +0100
commit2c0544a7b88641a98f90f892ccac1d77aeae56a1 (patch)
treec109e1f62b99bdc2161294a8bb0f426ba00b2b05 /servers
parent4746e874ad6f38ff1c810e9c0108aef0ac208971 (diff)
parent3d28cb3cd349f9a90f95cd301476179a837ff688 (diff)
Merge pull request #67878 from clayjohn/RD-particles-amount
Correctly set number of particle dispatches when setting view axis
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/particles_storage.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
index 240f743387..7fa0bb64a3 100644
--- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
@@ -1220,7 +1220,9 @@ void ParticlesStorage::particles_set_view_axis(RID p_particles, const Vector3 &p
RendererCompositorRD::singleton->get_effects()->sort_buffer(particles->particles_sort_uniform_set, particles->amount);
}
- copy_push_constant.total_particles *= copy_push_constant.total_particles;
+ if (particles->trails_enabled && particles->trail_bind_poses.size() > 1) {
+ copy_push_constant.total_particles *= particles->trail_bind_poses.size();
+ }
RD::ComputeListID compute_list = RD::get_singleton()->compute_list_begin();
uint32_t copy_pipeline = do_sort ? ParticlesShader::COPY_MODE_FILL_INSTANCES_WITH_SORT_BUFFER : ParticlesShader::COPY_MODE_FILL_INSTANCES;