[dali_1.1.15] Merge branch 'devel/master'
[platform/core/uifw/dali-demo.git] / resources / scripts / shader-effect-ripple.json
1 {
2   "stage": [
3     {
4       "type": "ImageActor",
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       "effect": "Ripple2D",
15       "image": {
16         "filename": "{DALI_IMAGE_DIR}gallery-medium-25.jpg",
17         "width": 400,
18         "height": 400,
19         "loadPolicy": "IMMEDIATE",
20         "releasePolicy": "NEVER"
21       },
22       "signals": [
23         {
24           "name": "onStage",
25           "action": "play",
26           "animation": "Animation_1"
27         }
28       ]
29     }
30   ],
31   "paths": {},
32   "animations": {
33     "Animation_1": {
34       "loop":true,
35       "properties": [
36         {
37           "actor": "Image1",
38           "property": "uTime",
39           "value": 36.0,
40           "alphaFunction": "LINEAR",
41           "timePeriod": {
42             "delay": 0,
43             "duration": 20.0
44           },
45           "guiBuilderTimelineColor": "#8dc0da"
46         }
47       ]
48     }
49   },
50   "shaderEffects": {
51     "Ripple2D": {
52       "program": {
53         "vertexPrefix": "",
54         "vertex": "void main(void)\n{\n  gl_Position = uMvpMatrix * vec4(aPosition*uSize.xy, 0.0, 1.0);\n  vTexCoord = mix( uTextureRect.xy, uTextureRect.zw, aPosition + vec2(0.5) );\n}\n\n",
55         "fragmentPrefix": "",
56         "fragment": "precision mediump float;\nuniform float uAmplitude; // 0.02; (< 1)\nuniform float uTime;\nvoid main()\n{\n  highp vec2 textureSize = uTextureRect.zw - uTextureRect.xy;\n  highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\n  highp float len = length(pos);\n  highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \n  gl_FragColor = texture2D(sTexture, texCoord) * uColor;\n}\n\n\n",
57         "geometryType": "GEOMETRY_TYPE_IMAGE"
58       },
59       "geometryHints": "HINT_NONE",
60       "gridDensity": 0,
61       "loop": true,
62       "uAmplitude": 0.02,
63       "uTime": 0.0
64     }
65   }
66 }