DALi Version 1.4.27
[platform/core/uifw/dali-demo.git] / resources / scripts / shader-effect-ripple.json
1 {
2   "stage": [
3     {
4       "type": "ImageView",
5       "name": "Image1",
6       "position": [
7         0.40461349487305,
8         0.9150390625,
9         0.0
10       ],
11       "parentOrigin": [0.5, 0.5, 0.5],
12       "widthResizePolicy":"FILL_TO_PARENT",
13       "heightResizePolicy":"DIMENSION_DEPENDENCY",
14       "image": {
15         "url": "{DEMO_IMAGE_DIR}gallery-medium-25.jpg",
16         "desiredWidth": 400,
17         "desiredHeight": 400,
18         "shader": {
19           "fragmentShader": [
20               "precision mediump float;",
21               "uniform sampler2D sTexture;",
22               "uniform vec4 uColor;",
23               "uniform float uAmplitude;",
24               "uniform float uTime;",
25               "varying vec2 vTexCoord;",
26               "void main()",
27               "{",
28               "  highp vec2 pos = -1.0 + 2.0 * vTexCoord;",
29               "  highp float len = length(pos);",
30               "  highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;",
31               "  gl_FragColor = texture2D(sTexture, texCoord) * uColor;",
32               "}"
33             ]
34           }
35       },
36       "animatableProperties": {
37         "uAmplitude": 0.02,
38         "uTime": 0.0
39       },
40       "signals": [
41         {
42           "name": "onStage",
43           "action": "play",
44           "animation": "Animation_1"
45         }
46       ]
47     }
48   ],
49   "animations": {
50     "Animation_1": {
51       "loop":true,
52       "properties": [
53         {
54           "actor": "Image1",
55           "property": "uTime",
56           "value": 36.0,
57           "alphaFunction": "LINEAR",
58           "timePeriod": {
59             "delay": 0,
60             "duration": 20.0
61           },
62           "guiBuilderTimelineColor": "#8dc0da"
63         }
64       ]
65     }
66   }
67 }