Initial commit
This commit is contained in:
18
shaders/initiateParticles.wgsl
Normal file
18
shaders/initiateParticles.wgsl
Normal file
@@ -0,0 +1,18 @@
|
||||
@group(0) @binding(0)
|
||||
var<storage, read> initiationPositions : array<vec4<f32>>;
|
||||
|
||||
@group(0) @binding(1)
|
||||
var<storage, read_write> positions : array<vec4<f32>>;
|
||||
|
||||
@group(0) @binding(2)
|
||||
var<storage, read_write> velocities : array<vec2<f32>>;
|
||||
|
||||
@compute @workgroup_size(64)
|
||||
fn initialize(@builtin(global_invocation_id) id : vec3<u32>) {
|
||||
|
||||
let i = id.x;
|
||||
|
||||
positions[i] = initiationPositions[i];
|
||||
|
||||
velocities[i] = vec2<f32>(0.0, 0.0);
|
||||
}
|
||||
Reference in New Issue
Block a user