Skip to content
Snippets Groups Projects
Verified Commit 7deb24cc authored by Josch Morgenstern's avatar Josch Morgenstern
Browse files

[#111] change particle struct, remove lifetime

parent eecd1cda
No related branches found
No related tags found
1 merge request!95Resolve "Wassersimulation mit Interaktion"
Pipeline #27207 passed
...@@ -6,11 +6,11 @@ layout(location = 0) in vec3 particle; ...@@ -6,11 +6,11 @@ layout(location = 0) in vec3 particle;
struct Particle struct Particle
{ {
vec3 position; vec3 position;
float lifeTime; float padding;
vec3 velocity; vec3 velocity;
float padding_2; float density;
vec3 reset_velocity; vec3 force;
float padding_3; float pressure;
}; };
layout(std430, binding = 2) readonly buffer buffer_inParticle1 layout(std430, binding = 2) readonly buffer buffer_inParticle1
...@@ -30,13 +30,12 @@ layout( push_constant ) uniform constants{ ...@@ -30,13 +30,12 @@ layout( push_constant ) uniform constants{
layout(location = 0) out vec2 passTriangleCoordinates; layout(location = 0) out vec2 passTriangleCoordinates;
layout(location = 1) out vec3 passVelocity; layout(location = 1) out vec3 passVelocity;
layout(location = 2) out float passlifeTime;
void main() void main()
{ {
int id = gl_InstanceIndex; int id = gl_InstanceIndex;
passVelocity = inParticle1[id].velocity; passVelocity = inParticle1[id].velocity;
passlifeTime = inParticle1[id].lifeTime;
// particle position in view space // particle position in view space
vec4 positionView = view * vec4(inParticle1[id].position, 1); vec4 positionView = view * vec4(inParticle1[id].position, 1);
// by adding the triangle position in view space the mesh is always camera facing // by adding the triangle position in view space the mesh is always camera facing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment