aabc376d3f8fa396881cdfce133cd9f43246239b
[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": "precision mediump float;\nuniform sampler2D sTexture;\nuniform vec4 uColor;\nuniform float uAmplitude;\nuniform float uTime;\nvarying vec2 vTexCoord;\nvoid main()\n{\n  highp vec2 pos = -1.0 + 2.0 * vTexCoord;\n  highp float len = length(pos);\n  highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\n  gl_FragColor = texture2D(sTexture, texCoord) * uColor;}\n\n"
20           }
21       },
22       "animatableProperties": {
23         "uAmplitude": 0.02,
24         "uTime": 0.0
25       },
26       "signals": [
27         {
28           "name": "onStage",
29           "action": "play",
30           "animation": "Animation_1"
31         }
32       ]
33     }
34   ],
35   "animations": {
36     "Animation_1": {
37       "loop":true,
38       "properties": [
39         {
40           "actor": "Image1",
41           "property": "uTime",
42           "value": 36.0,
43           "alphaFunction": "LINEAR",
44           "timePeriod": {
45             "delay": 0,
46             "duration": 20.0
47           },
48           "guiBuilderTimelineColor": "#8dc0da"
49         }
50       ]
51     }
52   }
53 }