From 0a75ccea17f07a37a40cda78c8f9678956eb229d Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 26 Jan 2017 18:36:47 +0000 Subject: [PATCH 1/1] Split shaders in JSONs over multiple lines Change-Id: I231d03ba20e15626ed7d6020d65fbbac3411ccff --- resources/scripts/shader-effect-ripple.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/scripts/shader-effect-ripple.json b/resources/scripts/shader-effect-ripple.json index aabc376..24a5fb3 100644 --- a/resources/scripts/shader-effect-ripple.json +++ b/resources/scripts/shader-effect-ripple.json @@ -16,7 +16,21 @@ "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" + "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": { -- 2.7.4