Commit 93ece7f6cf68ea99d16580065168755667f3388b

Authored by Adeel Kazmi
Committed by Gerrit Code Review
2 parents d083dff4 6a7da142

Merge "Update the ShaderEffect script to resize the geometry" into devel/master

resources/scripts/shader-effect-ripple.json
... ... @@ -51,9 +51,9 @@
51 51 "Ripple2D": {
52 52 "program": {
53 53 "vertexPrefix": "",
54   - "vertex": "void main(void)\n{\n gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\n vTexCoord = aTexCoord;\n}\n\n",
  54 + "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",
55 55 "fragmentPrefix": "",
56   - "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 + "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",
57 57 "geometryType": "GEOMETRY_TYPE_IMAGE"
58 58 },
59 59 "geometryHints": "HINT_NONE",
... ...