Moved shaders to new directory
This commit is contained in:
parent
0b3f8340e3
commit
99b226237a
1244 changed files with 0 additions and 0 deletions
30
shaders/glsl/computenbody/particle_integrate.comp
Normal file
30
shaders/glsl/computenbody/particle_integrate.comp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#version 450
|
||||
|
||||
struct Particle
|
||||
{
|
||||
vec4 pos;
|
||||
vec4 vel;
|
||||
};
|
||||
|
||||
// Binding 0 : Position storage buffer
|
||||
layout(std140, binding = 0) buffer Pos
|
||||
{
|
||||
Particle particles[ ];
|
||||
};
|
||||
|
||||
layout (local_size_x = 256) in;
|
||||
|
||||
layout (binding = 1) uniform UBO
|
||||
{
|
||||
float deltaT;
|
||||
int particleCount;
|
||||
} ubo;
|
||||
|
||||
void main()
|
||||
{
|
||||
int index = int(gl_GlobalInvocationID);
|
||||
vec4 position = particles[index].pos;
|
||||
vec4 velocity = particles[index].vel;
|
||||
position += ubo.deltaT * velocity;
|
||||
particles[index].pos = position;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue