1#define_import_path bevy_gaussian_splatting::morph::particle 3#import bevy_gaussian_splatting::bindings::{ 8#import bevy_gaussian_splatting::spherical_harmonics::spherical_harmonics_lookup 9#import bevy_gaussian_splatting::transform::{ 14struct ParticleBehavior { 15 @location(0) indicies: vec4<i32>, 16 @location(1) velocity: vec4<f32>, 17 @location(2) acceleration: vec4<f32>, 18 @location(3) jerk: vec4<f32>, 21@group(3) @binding(7) var<storage, read_write> particle_behaviors: array<ParticleBehavior>; 23@compute @workgroup_size(32, 32) 24fn apply_particle_behaviors( 25 @builtin(local_invocation_id) gl_LocalInvocationID: vec3<u32>, 26 @builtin(global_invocation_id) gl_GlobalInvocationID: vec3<u32>, 28 let behavior_index = gl_GlobalInvocationID.x * 32u + gl_GlobalInvocationID.y; 29 let behavior = particle_behaviors[behavior_index]; 31 let point_index = behavior.indicies.x; 32 let point = position_visibility[point_index]; 36 let delta_position = behavior.velocity * globals.delta_time + 0.5 * behavior.acceleration * globals.delta_time * globals.delta_time + 1.0 / 6.0 * behavior.jerk * globals.delta_time * globals.delta_time * globals.delta_time; 37 let delta_velocity = behavior.acceleration * globals.delta_time + 0.5 * behavior.jerk * globals.delta_time * globals.delta_time; 38 let delta_acceleration = behavior.jerk * globals.delta_time; 40 let new_position = point + delta_position; 41 let new_velocity = behavior.velocity + delta_velocity; 42 let new_acceleration = behavior.acceleration + delta_acceleration; 46 if (behavior.indicies.x < 0) { 50 position_visibility[point_index] = new_position; 51 particle_behaviors[behavior_index].velocity = new_velocity; 52 particle_behaviors[behavior_index].acceleration = new_acceleration;