Updated shader source to set precision explicitly
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / shader-effects / iris-effect.cpp
index 7c49ab9..38a83dd 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <dali-toolkit/public-api/shader-effects/iris-effect.h>
 namespace Dali
@@ -47,11 +48,11 @@ IrisEffect IrisEffect::New()
   // append the default version
   std::string vertexShader(
               "uniform mediump vec2 uCenter;\n"
-              "varying vec2 vRelativePosition;\n"
+              "varying mediump vec2 vRelativePosition;\n"
               "\n"
               "void main()\n"
               "{\n"
-              "    vec4 world = uModelView * vec4(aPosition,1.0);\n"
+              "    mediump vec4 world = uModelView * vec4(aPosition,1.0);\n"
               "    gl_Position = uProjection * world;\n"
               "    \n"
               "    vTexCoord = aTexCoord;\n"
@@ -59,12 +60,12 @@ IrisEffect IrisEffect::New()
               "}\n");
 
   std::string fragmentShader(
-              "uniform float uRadius;                                                           \n"
-              "uniform float uBlendFactor;                                                      \n"
-              "varying vec2 vRelativePosition;                                                  \n"
+              "uniform mediump float uRadius;                                                           \n"
+              "uniform mediump float uBlendFactor;                                                      \n"
+              "varying mediump vec2 vRelativePosition;                                                  \n"
               "void main()                                                                      \n"
               "{                                                                                \n"
-              "   float delta = (length(vRelativePosition) - uRadius);                          \n"
+              "   mediump float delta = (length(vRelativePosition) - uRadius);                          \n"
               "   delta = clamp(0.0 - delta * uBlendFactor, 0.0, 1.0);                          \n"
               "   gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;                       \n"
               "   gl_FragColor.a *= delta;                                                      \n"
@@ -117,4 +118,3 @@ const std::string& IrisEffect::GetCenterPropertyName() const
 
 }
 }
-