diff options
author | Lee Morgan <Lee.morgan@partner.samsung.com> | 2015-05-01 14:50:38 +0100 |
---|---|---|
committer | Adeel Kazmi <adeel.kazmi@samsung.com> | 2015-05-07 10:41:43 +0100 |
commit | bea27f473827595516b17285a48d8bfa672609f6 (patch) | |
tree | 2428391de9b60817b962b2c7df64a62857089ec2 /resources/scripts | |
parent | d03b0b80e0ca068731f772631aec547da713bae3 (diff) | |
download | dali-demo-bea27f473827595516b17285a48d8bfa672609f6.tar.gz dali-demo-bea27f473827595516b17285a48d8bfa672609f6.tar.bz2 dali-demo-bea27f473827595516b17285a48d8bfa672609f6.zip |
Added JSON shader effect
Change-Id: Ie55026f59d4d956f3982d9ed3ba43e3cf4efa7eb
Diffstat (limited to 'resources/scripts')
-rw-r--r-- | resources/scripts/shader-effect-ripple.json | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/resources/scripts/shader-effect-ripple.json b/resources/scripts/shader-effect-ripple.json new file mode 100644 index 00000000..82f8d233 --- /dev/null +++ b/resources/scripts/shader-effect-ripple.json @@ -0,0 +1,65 @@ +{ + "stage": [ + { + "type": "ImageActor", + "name": "Image1", + "position": [ + 0.40461349487305, + 0.9150390625, + 0.0 + ], + "parent-origin": [0.5, 0.5, 0.5], + "size": [200, 200, 0], + "effect": "Ripple2D", + "image": { + "filename": "{DALI_IMAGE_DIR}gallery-medium-25.jpg", + "width": 200, + "height": 80, + "load-policy": "IMMEDIATE", + "release-policy": "NEVER" + }, + "signals": [ + { + "name": "on-stage", + "action": "play", + "animation": "Animation_1" + } + ] + } + ], + "paths": {}, + "animations": { + "Animation_1": { + "loop":true, + "properties": [ + { + "actor": "Image1", + "property": "uTime", + "value": 10.0, + "alpha-function": "LINEAR", + "time-period": { + "delay": 0, + "duration": 10.0 + }, + "gui-builder-timeline-color": "#8dc0da" + } + ] + } + }, + "shader-effects": { + "Ripple2D": { + "program": { + "vertexPrefix": "", + "vertex": "void main(void)\n{\n gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\n vTexCoord = aTexCoord;\n}\n\n", + "fragmentPrefix": "", + "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", + "geometry-type": "GEOMETRY_TYPE_IMAGE" + }, + "geometry-hints": "HINT_NONE", + "grid-density": 0, + "loop": true, + "uAmplitude": 0.02, + "uTime": 0.0 + } + } +} |