summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Steele <david.steele@samsung.com>2024-11-11 17:24:45 +0000
committerDavid Steele <david.steele@samsung.com>2024-11-18 15:32:27 +0000
commit870b5284620ab27b66dd45ccf9843bb85cfe4f8a (patch)
tree019d0d93ca0e3d9226e18b9e936020eb972d3f7a
parent5677f92c4cc87e50bd46fa26d10097b96d6f5b68 (diff)
downloaddali-demo-devel/master.tar.gz
dali-demo-devel/master.tar.bz2
dali-demo-devel/master.zip
Fixed sparkle demo uniform to be uniquedevel/master
Change-Id: Ia80afeac6686a87126cee65b7f502dff2169666d
-rw-r--r--examples/sparkle/shaders/sparkle-effect.vert6
-rw-r--r--examples/sparkle/sparkle-effect-example.cpp4
-rw-r--r--examples/sparkle/sparkle-effect.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/sparkle/shaders/sparkle-effect.vert b/examples/sparkle/shaders/sparkle-effect.vert
index bc72f994..45689ab8 100644
--- a/examples/sparkle/shaders/sparkle-effect.vert
+++ b/examples/sparkle/shaders/sparkle-effect.vert
@@ -24,7 +24,7 @@ UNIFORM float uTapOffset[MAXIMUM_ANIMATION_COUNT];
UNIFORM vec2 uTapPoint[MAXIMUM_ANIMATION_COUNT];
UNIFORM float uAcceleration;
UNIFORM float uRadius;
-UNIFORM float uScale;
+UNIFORM float uEffectScale;
UNIFORM float uBreak;
};
@@ -78,8 +78,8 @@ void main()
position = mix( position, vec2( 250.0,250.0 ),uBreak*(1.0-uOpacity[int(idx)]) ) ;
// vertex position on the mesh: (sign(aTexCoord.x), sign(aTexCoord.y))*PARTICLE_HALF_SIZE
- gl_Position = uMvpMatrix * vec4( position.x+sign(aTexCoord.x)*PARTICLE_HALF_SIZE/uScale,
- position.y+sign(aTexCoord.y)*PARTICLE_HALF_SIZE/uScale,
+ gl_Position = uMvpMatrix * vec4( position.x+sign(aTexCoord.x)*PARTICLE_HALF_SIZE/uEffectScale,
+ position.y+sign(aTexCoord.y)*PARTICLE_HALF_SIZE/uEffectScale,
0.0, 1.0 );
// we store the color index inside texCoord attribute
diff --git a/examples/sparkle/sparkle-effect-example.cpp b/examples/sparkle/sparkle-effect-example.cpp
index a6c7a83c..3f7d9ebb 100644
--- a/examples/sparkle/sparkle-effect-example.cpp
+++ b/examples/sparkle/sparkle-effect-example.cpp
@@ -356,12 +356,12 @@ private:
// prepare the animation by setting the uniform to the required value
mEffect.SetProperty(mEffect.GetPropertyIndex(BREAK_UNIFORM_NAME), 1.f);
mMeshActor.SetProperty(Actor::Property::SCALE, 0.01f);
- mEffect.SetProperty(mEffect.GetPropertyIndex("uScale"), 0.01f);
+ mEffect.SetProperty(mEffect.GetPropertyIndex("uEffectScale"), 0.01f);
mMeshActor.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.f, 1.f));
Animation breakAnimation = Animation::New(duration * 1.5f);
breakAnimation.AnimateTo(Property(mMeshActor, Actor::Property::SCALE), Vector3(ACTOR_SCALE, ACTOR_SCALE, ACTOR_SCALE), EaseOutSquare);
- breakAnimation.AnimateTo(Property(mEffect, "uScale"), ACTOR_SCALE, EaseOutSquare);
+ breakAnimation.AnimateTo(Property(mEffect, "uEffectScale"), ACTOR_SCALE, EaseOutSquare);
breakAnimation.AnimateTo(Property(mMeshActor, Actor::Property::POSITION), ACTOR_POSITION, EaseOutSquare);
breakAnimation.FinishedSignal().Connect(this, &SparkleEffectExample::OnBreakAnimationFinished);
diff --git a/examples/sparkle/sparkle-effect.h b/examples/sparkle/sparkle-effect.h
index 2f0247ad..2deee478 100644
--- a/examples/sparkle/sparkle-effect.h
+++ b/examples/sparkle/sparkle-effect.h
@@ -244,7 +244,7 @@ Shader New()
handle.RegisterProperty(oss.str(), PARTICLE_COLORS[i].RGB);
}
handle.RegisterProperty("uRadius", 250.f);
- handle.RegisterProperty("uScale", ACTOR_SCALE);
+ handle.RegisterProperty("uEffectScale", ACTOR_SCALE);
// set the initial uniform values