Rework garden simulation pipelines
This commit is contained in:
parent
c2efb33683
commit
018f8c9d4d
67 changed files with 6499 additions and 1682 deletions
21
src/pipelines/agents/agent-generation/agent-resize.wgsl
Normal file
21
src/pipelines/agents/agent-generation/agent-resize.wgsl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
struct ResizeSettings {
|
||||
scale: vec2<f32>,
|
||||
agentCount: u32,
|
||||
};
|
||||
|
||||
@group(1) @binding(0) var<uniform> resizeSettings: ResizeSettings;
|
||||
|
||||
@compute @workgroup_size(agentWorkgroupSize)
|
||||
fn main(
|
||||
@builtin(global_invocation_id) global_id: vec3<u32>
|
||||
) {
|
||||
let id = get_id(global_id);
|
||||
|
||||
if id >= resizeSettings.agentCount {
|
||||
return;
|
||||
}
|
||||
|
||||
let scale = resizeSettings.scale;
|
||||
agents[id].position = agents[id].position * scale;
|
||||
agents[id].targetPosition = agents[id].targetPosition * scale;
|
||||
}
|
||||
Loading…
Reference in a new issue