Merge pull request #7615 from zzmp/fix/amd-particles

Add explicit layout to textured particle shader
This commit is contained in:
Brad Davis 2016-04-08 13:19:41 -07:00
commit 8e1e11a6f8
2 changed files with 4 additions and 3 deletions

View file

@ -39,6 +39,7 @@ public:
InterpolationData<float> radius;
InterpolationData<glm::vec4> color; // rgba
float lifespan;
glm::vec3 spare;
};
struct ParticlePrimitive {

View file

@ -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