(Builder Example) Use the shader constant provided by builder to ensure script works... 83/252483/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 28 Jan 2021 16:44:38 +0000 (16:44 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 28 Jan 2021 16:44:47 +0000 (16:44 +0000)
Change-Id: Iaad736c5a2924518bff95f3a12d4a8eae2949289

resources/scripts/shader-effect-ripple.json

index c64cc18..2469824 100644 (file)
         "desiredHeight": 400,
         "shader": {
           "fragmentShader": [
+              "{DALI_FRAGMENT_SHADER_PREFIX}",
               "precision mediump float;",
               "uniform sampler2D sTexture;",
               "uniform vec4 uColor;",
               "uniform float uAmplitude;",
               "uniform float uTime;",
-              "varying vec2 vTexCoord;",
+              "INPUT 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;",
+              "  OUT_COLOR = TEXTURE(sTexture, texCoord) * uColor;",
               "}"
             ]
           }