X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resources%2Fscripts%2Fshader-effect-ripple.json;h=24a5fb3a75ecc9cc9f59bdf5da362cc059b93e83;hb=3293b5b24087b52a84b5ed7fe5598a5291bf29e3;hp=e32fc1e6fb007de314bb86042bd86e2dcc667a4a;hpb=6a7da142f862f17d1c1e2daa1a34461e0704ca91;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/resources/scripts/shader-effect-ripple.json b/resources/scripts/shader-effect-ripple.json index e32fc1e..24a5fb3 100644 --- a/resources/scripts/shader-effect-ripple.json +++ b/resources/scripts/shader-effect-ripple.json @@ -1,7 +1,7 @@ { "stage": [ { - "type": "ImageActor", + "type": "ImageView", "name": "Image1", "position": [ 0.40461349487305, @@ -11,13 +11,31 @@ "parentOrigin": [0.5, 0.5, 0.5], "widthResizePolicy":"FILL_TO_PARENT", "heightResizePolicy":"DIMENSION_DEPENDENCY", - "effect": "Ripple2D", "image": { - "filename": "{DALI_IMAGE_DIR}gallery-medium-25.jpg", - "width": 400, - "height": 400, - "loadPolicy": "IMMEDIATE", - "releasePolicy": "NEVER" + "url": "{DEMO_IMAGE_DIR}gallery-medium-25.jpg", + "desiredWidth": 400, + "desiredHeight": 400, + "shader": { + "fragmentShader": [ + "precision mediump float;", + "uniform sampler2D sTexture;", + "uniform vec4 uColor;", + "uniform float uAmplitude;", + "uniform float uTime;", + "varying vec2 vTexCoord;", + "void main()", + "{", + " highp vec2 pos = -1.0 + 2.0 * vTexCoord;", + " highp float len = length(pos);", + " highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;", + " gl_FragColor = texture2D(sTexture, texCoord) * uColor;", + "}" + ] + } + }, + "animatableProperties": { + "uAmplitude": 0.02, + "uTime": 0.0 }, "signals": [ { @@ -28,7 +46,6 @@ ] } ], - "paths": {}, "animations": { "Animation_1": { "loop":true, @@ -46,21 +63,5 @@ } ] } - }, - "shaderEffects": { - "Ripple2D": { - "program": { - "vertexPrefix": "", - "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", - "fragmentPrefix": "", - "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", - "geometryType": "GEOMETRY_TYPE_IMAGE" - }, - "geometryHints": "HINT_NONE", - "gridDensity": 0, - "loop": true, - "uAmplitude": 0.02, - "uTime": 0.0 - } } }