Skip to content

Commit e1d6ab4

Browse files
committed
Fix userdata not copied when trails started
1 parent 6b281c0 commit e1d6ab4

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

servers/rendering/renderer_rd/shaders/particles.glsl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,24 @@ void main() {
292292
PARTICLE.velocity = particles.data[src_idx].velocity;
293293
PARTICLE.flags = PARTICLE_FLAG_TRAILED | ((frame_history.data[0].frame & PARTICLE_FRAME_MASK) << PARTICLE_FRAME_SHIFT); //mark it as trailed, save in which frame it will start
294294
PARTICLE.xform = particles.data[src_idx].xform;
295+
#ifdef USERDATA1_USED
296+
PARTICLE.userdata1 = particles.data[src_idx].userdata1;
297+
#endif
298+
#ifdef USERDATA2_USED
299+
PARTICLE.userdata2 = particles.data[src_idx].userdata2;
300+
#endif
301+
#ifdef USERDATA3_USED
302+
PARTICLE.userdata3 = particles.data[src_idx].userdata3;
303+
#endif
304+
#ifdef USERDATA4_USED
305+
PARTICLE.userdata4 = particles.data[src_idx].userdata4;
306+
#endif
307+
#ifdef USERDATA5_USED
308+
PARTICLE.userdata5 = particles.data[src_idx].userdata5;
309+
#endif
310+
#ifdef USERDATA6_USED
311+
PARTICLE.userdata6 = particles.data[src_idx].userdata6;
312+
#endif
295313
}
296314
if (!bool(particles.data[src_idx].flags & PARTICLE_FLAG_ACTIVE)) {
297315
// Disable the entire trail if the parent is no longer active.

0 commit comments

Comments
 (0)