From: Francisco Santos Date: Fri, 26 Jun 2015 14:24:45 +0000 (+0100) Subject: Merge branch 'devel/new_mesh' into devel/master X-Git-Tag: dali_1.0.47~13 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=d3a00dc1c24ece2488696c0b518013ad6d97969b Merge branch 'devel/new_mesh' into devel/master Change-Id: I41d2ce44857efc23c3a830ede52849b4d415b6f6 --- d3a00dc1c24ece2488696c0b518013ad6d97969b diff --cc dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index 7f38bd4,177f927..d278eb4 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@@ -38,33 -39,32 +39,32 @@@ namespace Interna namespace { // Bouncing effect is presented by stacked three layers with same color and opacity - const size_t NUM_LAYERS( 3 ); const Vector3 LAYER_HEIGHTS( 1.f, 27.f/42.f, 13.f/42.f); - // use the actor color to paint every layer - const char* MESH_FRAGMENT_SHADER = - "void main()\n" - "{\n" - " gl_FragColor = uColor;\n" - "}\n"; - - // Constraint to move the vertices vertically - struct VertexPositionConstraint - { - VertexPositionConstraint( float initialY, float range ) - : mInitialY( initialY ), - mRange( range ) - { - } - - void operator()( Vector3& current, const PropertyInputContainer& inputs ) - { - current.y = mInitialY + mRange * fabsf( inputs[0]->GetFloat() ); - } + #define MAKE_SHADER(A)#A + + // Modify the vertex position according to the bounce coefficient; + const char* MESH_VERTEX_SHADER = MAKE_SHADER( + attribute mediump vec3 aPosition1;\n + attribute mediump vec3 aPosition2;\n + uniform mediump mat4 uMvpMatrix;\n + uniform mediump vec3 uSize; + uniform mediump float uBounceCoefficient;\n + \n + void main()\n + {\n + gl_Position = uMvpMatrix * vec4(mix( aPosition1, aPosition2, abs(uBounceCoefficient) )*uSize, 1.0);\n + } + ); - float mInitialY; - float mRange; - }; + // use the actor color to paint every layer + const char* MESH_FRAGMENT_SHADER = MAKE_SHADER( + uniform lowp vec4 uColor;\n + void main()\n + {\n + gl_FragColor = uColor;\n -}\n; ++}\n + ); } // namespace Anon