X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fshader-effects%2Fmirror-effect.cpp;h=8a11c06f83f7fd94f2c5c2c0fcd8da0812538fad;hb=f441aaa6d92cdb2d2a11d026aae1e98b3f6d7c76;hp=4b72f0f68e7a94e292c618827b8842c8d5bfaa22;hpb=e2eda444afbe82e9591fe198eef339227f90a616;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/shader-effects/mirror-effect.cpp b/dali-toolkit/public-api/shader-effects/mirror-effect.cpp index 4b72f0f..8a11c06 100644 --- a/dali-toolkit/public-api/shader-effects/mirror-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/mirror-effect.cpp @@ -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 @@ -47,20 +48,19 @@ MirrorEffect::~MirrorEffect() MirrorEffect MirrorEffect::New() { - std::string vertextShader( - "precision mediump float; \n" + std::string vertexShader( "void main() \n" "{ \n" - " vec3 pos = aPosition; \n" + " mediump vec3 pos = aPosition; \n" " pos.y = pos.y * 3.0; \n" - " vec4 world = uModelView * vec4(pos,1.0); \n" + " mediump vec4 world = uModelView * vec4(pos,1.0); \n" " gl_Position = uProjection * world; \n" " vTexCoord = aTexCoord; \n" "} \n" ); std::string fragmentShader( - "uniform float uDepth; \n" - "uniform float uAlpha; \n" + "uniform mediump float uDepth; \n" + "uniform mediump float uAlpha; \n" "void main() \n" "{ \n" " if(vTexCoord.y < 1.0 / 3.0) \n" @@ -74,9 +74,9 @@ MirrorEffect MirrorEffect::New() " } \n" " else \n" " { \n" - " float darkness = 3.0 - vTexCoord.y * 3.0; \n" + " highp float darkness = 3.0 - vTexCoord.y * 3.0; \n" " darkness = (1.0 - 1.0 / uDepth + darkness * 1.0/ uDepth) * 0.65; \n" - " vec4 color = texture2D(sTexture, vec2(vTexCoord.x, -vTexCoord.y *3.0 + 3.0)) * uColor; \n" + " highp vec4 color = texture2D(sTexture, vec2(vTexCoord.x, -vTexCoord.y *3.0 + 3.0)) * uColor; \n" " color.a *= uAlpha; \n" " gl_FragColor = color * vec4(darkness, darkness, darkness, darkness); \n" " } \n" @@ -84,7 +84,7 @@ MirrorEffect MirrorEffect::New() // Create the implementation, temporarily owned on stack, Dali::ShaderEffect shaderEffectCustom = Dali::ShaderEffect::New( - vertextShader, + vertexShader, fragmentShader, GeometryType( GEOMETRY_TYPE_IMAGE ), ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ));