Merge "Metaballs demos" into 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       "size": [200, 200, 0],
13       "effect": "Ripple2D",
14       "image": {
15         "filename": "{DALI_IMAGE_DIR}gallery-medium-25.jpg",
16         "width": 200,
17         "height": 80,
18         "loadPolicy": "IMMEDIATE",
19         "releasePolicy": "NEVER"
20       },
21       "signals": [
22         {
23           "name": "onStage",
24           "action": "play",
25           "animation": "Animation_1"
26         }
27       ]
28     }
29   ],
30   "paths": {},
31   "animations": {
32     "Animation_1": {
33       "loop":true,
34       "properties": [
35         {
36           "actor": "Image1",
37           "property": "uTime",
38           "value": 10.0,
39           "alphaFunction": "LINEAR",
40           "timePeriod": {
41             "delay": 0,
42             "duration": 10.0
43           },
44           "guiBuilderTimelineColor": "#8dc0da"
45         }
46       ]
47     }
48   },
49   "shaderEffects": {
50     "Ripple2D": {
51       "program": {
52         "vertexPrefix": "",
53         "vertex": "void main(void)\n{\n  gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\n  vTexCoord = aTexCoord;\n}\n\n",
54         "fragmentPrefix": "",
55         "fragment": "precision mediump float;\nuniform float uAmplitude; // 0.02; (< 1)\nuniform float uTime;\nvoid main()\n{\n  highp vec2 textureSize = sTextureRect.zw - sTextureRect.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",
56         "geometryType": "GEOMETRY_TYPE_IMAGE"
57       },
58       "geometryHints": "HINT_NONE",
59       "gridDensity": 0,
60       "loop": true,
61       "uAmplitude": 0.02,
62       "uTime": 0.0
63     }
64   }
65 }