Minor adjustments
This commit is contained in:
parent
6b17a8e023
commit
7dbeb2127c
6 changed files with 11 additions and 14 deletions
|
|
@ -21,6 +21,5 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
|||
angle,
|
||||
0,
|
||||
1000000,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ struct Agent {
|
|||
angle: f32,
|
||||
species: f32,
|
||||
timeToLive: f32,
|
||||
timeToLive2: f32,
|
||||
}
|
||||
|
||||
@group(1) @binding(1) var<storage, read_write> agents: array<Agent>;
|
||||
|
|
|
|||
|
|
@ -83,13 +83,13 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
|||
nextAngle = agent.angle + rotation;
|
||||
}
|
||||
|
||||
var trail = vec4<f32>(0, 1, 0, 0);
|
||||
var trail = vec4<f32>(0, 0.1, 0, 0);
|
||||
if (agent.species == 0) {
|
||||
trail = vec4(0.1, 0, 0, 0);
|
||||
}
|
||||
|
||||
let current = textureLoad(trailMapIn, vec2<i32>(nextPosition), 0);
|
||||
textureStore(trailMapOut, vec2<i32>(nextPosition), vec4(trail.rgb + current.rgb, 0));
|
||||
textureStore(trailMapOut, vec2<i32>(nextPosition), vec4(trail.rgb + current.rgb, current.a));
|
||||
|
||||
agent.position = nextPosition;
|
||||
agent.angle = nextAngle;
|
||||
|
|
|
|||
Loading…
Reference in a new issue