Fix vertex shader (nested struct unsupported)

This commit is contained in:
Atlante45 2015-11-23 17:53:22 -08:00
parent d08a4d77dc
commit 4827a96bfa
2 changed files with 20 additions and 19 deletions

View file

@ -152,7 +152,7 @@ RenderableParticleEffectEntityItem::RenderableParticleEffectEntityItem(const Ent
ParticleEffectEntityItem(entityItemID, properties) { ParticleEffectEntityItem(entityItemID, properties) {
// lazy creation of particle system pipeline // lazy creation of particle system pipeline
if (!_untexturedPipeline && !_texturedPipeline) { if (!_untexturedPipeline || !_texturedPipeline) {
createPipelines(); createPipelines();
} }
} }

View file

@ -14,21 +14,22 @@
<$declareStandardTransform()$> <$declareStandardTransform()$>
struct Radiuses {
float start;
float middle;
float finish;
float spread;
};
struct Colors {
vec4 start;
vec4 middle;
vec4 finish;
vec4 spread;
};
struct ParticleUniforms { struct ParticleUniforms {
struct { Radiuses radius;
float start; Colors color;
float middle;
float finish;
float spread;
} radius;
struct {
vec4 start;
vec4 middle;
vec4 finish;
vec4 spread;
} color;
float lifespan; float lifespan;
}; };
@ -44,10 +45,10 @@ out vec2 varTexcoord;
const int NUM_VERTICES_PER_PARTICLE = 4; const int NUM_VERTICES_PER_PARTICLE = 4;
const vec4 UNIT_QUAD[NUM_VERTICES_PER_PARTICLE] = vec4[NUM_VERTICES_PER_PARTICLE]( const vec4 UNIT_QUAD[NUM_VERTICES_PER_PARTICLE] = vec4[NUM_VERTICES_PER_PARTICLE](
vec4(-1.0, -1.0, 0.0, 1.0), vec4(-1.0, -1.0, 0.0, 0.0),
vec4(1.0, -1.0, 0.0, 1.0), vec4(1.0, -1.0, 0.0, 0.0),
vec4(-1.0, 1.0, 0.0, 1.0), vec4(-1.0, 1.0, 0.0, 0.0),
vec4(1.0, 1.0, 0.0, 1.0) vec4(1.0, 1.0, 0.0, 0.0)
); );
float bezierInterpolate(float y1, float y2, float y3, float u) { float bezierInterpolate(float y1, float y2, float y3, float u) {