X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resources%2Fscripts%2Fshader-effect-ripple.json;h=aabc376d3f8fa396881cdfce133cd9f43246239b;hb=2cfafe99d72918b8b1326e0726b9b6ae8e0191f0;hp=82f8d2336f97647df59cea7457c82ded3de752e4;hpb=661d97a34184795b6a99266a4a8b744f5fc11aa8;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/resources/scripts/shader-effect-ripple.json b/resources/scripts/shader-effect-ripple.json index 82f8d23..aabc376 100644 --- a/resources/scripts/shader-effect-ripple.json +++ b/resources/scripts/shader-effect-ripple.json @@ -1,33 +1,37 @@ { "stage": [ { - "type": "ImageActor", + "type": "ImageView", "name": "Image1", "position": [ 0.40461349487305, 0.9150390625, 0.0 ], - "parent-origin": [0.5, 0.5, 0.5], - "size": [200, 200, 0], - "effect": "Ripple2D", + "parentOrigin": [0.5, 0.5, 0.5], + "widthResizePolicy":"FILL_TO_PARENT", + "heightResizePolicy":"DIMENSION_DEPENDENCY", "image": { - "filename": "{DALI_IMAGE_DIR}gallery-medium-25.jpg", - "width": 200, - "height": 80, - "load-policy": "IMMEDIATE", - "release-policy": "NEVER" + "url": "{DEMO_IMAGE_DIR}gallery-medium-25.jpg", + "desiredWidth": 400, + "desiredHeight": 400, + "shader": { + "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" + } + }, + "animatableProperties": { + "uAmplitude": 0.02, + "uTime": 0.0 }, "signals": [ { - "name": "on-stage", + "name": "onStage", "action": "play", "animation": "Animation_1" } ] } ], - "paths": {}, "animations": { "Animation_1": { "loop":true, @@ -35,31 +39,15 @@ { "actor": "Image1", "property": "uTime", - "value": 10.0, - "alpha-function": "LINEAR", - "time-period": { + "value": 36.0, + "alphaFunction": "LINEAR", + "timePeriod": { "delay": 0, - "duration": 10.0 + "duration": 20.0 }, - "gui-builder-timeline-color": "#8dc0da" + "guiBuilderTimelineColor": "#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 - } } }