Add basic compute simulation (disabled)
[lovr-particles] / shaders / particles.comp
1 uniform float dt;
2 struct particle_t {
3 vec4 positionAndSize;
4 vec4 velocity;
5 vec4 padding2; // for LÖVR's limited ShaderBlock type :(
6 vec4 padding3; // for LÖVR's limited ShaderBlock type :(
7 };
8 layout(std430) buffer particleData { particle_t particles[]; };
9
10 layout(local_size_x = 128) in;
11 void compute() {
12 uint particleId = gl_GlobalInvocationID.x;
13 particles[particleId].positionAndSize.xyz +=
14 particles[particleId].velocity.xyz * dt;
15 }