mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 05:03:31 +02:00
Fix vertex shader (nested struct unsupported)
This commit is contained in:
parent
d08a4d77dc
commit
4827a96bfa
2 changed files with 20 additions and 19 deletions
|
@ -152,7 +152,7 @@ RenderableParticleEffectEntityItem::RenderableParticleEffectEntityItem(const Ent
|
|||
ParticleEffectEntityItem(entityItemID, properties) {
|
||||
|
||||
// lazy creation of particle system pipeline
|
||||
if (!_untexturedPipeline && !_texturedPipeline) {
|
||||
if (!_untexturedPipeline || !_texturedPipeline) {
|
||||
createPipelines();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,21 +14,22 @@
|
|||
|
||||
<$declareStandardTransform()$>
|
||||
|
||||
struct Radiuses {
|
||||
float start;
|
||||
float middle;
|
||||
float finish;
|
||||
float spread;
|
||||
};
|
||||
struct Colors {
|
||||
vec4 start;
|
||||
vec4 middle;
|
||||
vec4 finish;
|
||||
vec4 spread;
|
||||
};
|
||||
|
||||
struct ParticleUniforms {
|
||||
struct {
|
||||
float start;
|
||||
float middle;
|
||||
float finish;
|
||||
float spread;
|
||||
} radius;
|
||||
|
||||
struct {
|
||||
vec4 start;
|
||||
vec4 middle;
|
||||
vec4 finish;
|
||||
vec4 spread;
|
||||
} color;
|
||||
|
||||
Radiuses radius;
|
||||
Colors color;
|
||||
float lifespan;
|
||||
};
|
||||
|
||||
|
@ -44,10 +45,10 @@ out vec2 varTexcoord;
|
|||
|
||||
const int NUM_VERTICES_PER_PARTICLE = 4;
|
||||
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, 1.0),
|
||||
vec4(-1.0, 1.0, 0.0, 1.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, 0.0),
|
||||
vec4(-1.0, 1.0, 0.0, 0.0),
|
||||
vec4(1.0, 1.0, 0.0, 0.0)
|
||||
);
|
||||
|
||||
float bezierInterpolate(float y1, float y2, float y3, float u) {
|
||||
|
|
Loading…
Reference in a new issue