Commit bea27f473827595516b17285a48d8bfa672609f6

Authored by Lee Morgan
Committed by Adeel Kazmi
1 parent d03b0b80

Added JSON shader effect

Change-Id: Ie55026f59d4d956f3982d9ed3ba43e3cf4efa7eb
resources/scripts/shader-effect-ripple.json 0 → 100644
  1 +{
  2 + "stage": [
  3 + {
  4 + "type": "ImageActor",
  5 + "name": "Image1",
  6 + "position": [
  7 + 0.40461349487305,
  8 + 0.9150390625,
  9 + 0.0
  10 + ],
  11 + "parent-origin": [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 + "load-policy": "IMMEDIATE",
  19 + "release-policy": "NEVER"
  20 + },
  21 + "signals": [
  22 + {
  23 + "name": "on-stage",
  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 + "alpha-function": "LINEAR",
  40 + "time-period": {
  41 + "delay": 0,
  42 + "duration": 10.0
  43 + },
  44 + "gui-builder-timeline-color": "#8dc0da"
  45 + }
  46 + ]
  47 + }
  48 + },
  49 + "shader-effects": {
  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 + "geometry-type": "GEOMETRY_TYPE_IMAGE"
  57 + },
  58 + "geometry-hints": "HINT_NONE",
  59 + "grid-density": 0,
  60 + "loop": true,
  61 + "uAmplitude": 0.02,
  62 + "uTime": 0.0
  63 + }
  64 + }
  65 +}
... ...