mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:43:25 +02:00
layout std140 in particle shader
This commit is contained in:
parent
50a081db00
commit
4e3ab73941
2 changed files with 4 additions and 3 deletions
|
@ -39,6 +39,7 @@ public:
|
|||
InterpolationData<float> radius;
|
||||
InterpolationData<glm::vec4> color; // rgba
|
||||
float lifespan;
|
||||
glm::vec3 spare;
|
||||
};
|
||||
|
||||
struct ParticlePrimitive {
|
||||
|
|
|
@ -30,10 +30,10 @@ struct Colors {
|
|||
struct ParticleUniforms {
|
||||
Radii radius;
|
||||
Colors color;
|
||||
float lifespan;
|
||||
vec4 lifespan; // x is lifespan, 3 spare floats
|
||||
};
|
||||
|
||||
uniform particleBuffer {
|
||||
layout(std140) uniform particleBuffer {
|
||||
ParticleUniforms particle;
|
||||
};
|
||||
|
||||
|
@ -112,7 +112,7 @@ void main(void) {
|
|||
int twoTriID = gl_VertexID - particleID * NUM_VERTICES_PER_PARTICLE;
|
||||
|
||||
// Particle properties
|
||||
float age = inColor.x / particle.lifespan;
|
||||
float age = inColor.x / particle.lifespan.x;
|
||||
float seed = inColor.y;
|
||||
|
||||
// Pass the texcoord and the z texcoord is representing the texture icon
|
||||
|
|
Loading…
Reference in a new issue