mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Updates for boids example Rename example folder Use chunks_muts when creating initial_particles data No need for depth Syntax and minor changes calculate multiple particles in single compute unit updates boids example to use framework impl removed code fix gpu invocations constants
12 lines
395 B
GLSL
12 lines
395 B
GLSL
#version 450
|
|
layout(location = 0) in vec2 a_particlePos;
|
|
layout(location = 1) in vec2 a_particleVel;
|
|
layout(location = 2) in vec2 a_pos;
|
|
|
|
void main() {
|
|
float angle = -atan(a_particleVel.x, a_particleVel.y);
|
|
vec2 pos = vec2(a_pos.x * cos(angle) - a_pos.y * sin(angle),
|
|
a_pos.x * sin(angle) + a_pos.y * cos(angle));
|
|
gl_Position = vec4(pos + a_particlePos, 0, 1);
|
|
}
|