X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=optional%2Fdali-toolkit%2Fpublic-api%2Fshader-effects%2Fsquare-dissolve-effect.cpp;h=0d3d3488a7417fbc4daf3d0009d3e5cf4d8e15ca;hp=72875ccaff605c21b7be63b126e702d46aeed967;hb=7d138e405ea2e5a116855616d3d9a5078dd56df0;hpb=e58fa784d19a558e35f458ecf6d262a2344beb4f diff --git a/optional/dali-toolkit/public-api/shader-effects/square-dissolve-effect.cpp b/optional/dali-toolkit/public-api/shader-effects/square-dissolve-effect.cpp index 72875cc..0d3d348 100644 --- a/optional/dali-toolkit/public-api/shader-effects/square-dissolve-effect.cpp +++ b/optional/dali-toolkit/public-api/shader-effects/square-dissolve-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 @@ -50,18 +51,18 @@ SquareDissolveEffect SquareDissolveEffect::New() { // variable "uStep" range scope : [0.0, 1.0] std::string fragmentShader( - "uniform vec2 texSize; \n" - "uniform float uStep; \n" - "uniform float uRows; \n" - "uniform float uColumns; \n" - "void main() \n" - "{ \n" - " vec2 mosaicSize = vec2(1.0 / uRows, 1.0 / uColumns); \n" - " vec2 intXY = vec2(vTexCoord.x * texSize.x, vTexCoord.y * texSize.y); \n" - " vec2 XYMosaic = vec2(floor(intXY.x / mosaicSize.x) * mosaicSize.x, floor(intXY.y / mosaicSize.y) * mosaicSize.y); \n" - " vec2 UVMosaic = vec2(XYMosaic.x /texSize.x, XYMosaic.y / texSize.y); \n" - " vec4 noiseVec = texture2D(sEffect, UVMosaic); \n" - " float intensity = (noiseVec[0] + noiseVec[1] + noiseVec[2] + noiseVec[3]) / 4.0; \n" + "uniform mediump vec2 texSize;\n" + "uniform mediump float uStep;\n" + "uniform mediump float uRows;\n" + "uniform mediump float uColumns;\n" + "void main()\n" + "{\n" + " mediump vec2 mosaicSize = vec2(1.0 / uRows, 1.0 / uColumns); \n" + " mediump vec2 intXY = vec2(vTexCoord.x * texSize.x, vTexCoord.y * texSize.y); \n" + " mediump vec2 XYMosaic = vec2(floor(intXY.x / mosaicSize.x) * mosaicSize.x, floor(intXY.y / mosaicSize.y) * mosaicSize.y); \n" + " mediump vec2 UVMosaic = vec2(XYMosaic.x /texSize.x, XYMosaic.y / texSize.y); \n" + " mediump vec4 noiseVec = texture2D(sEffect, UVMosaic); \n" + " mediump float intensity = (noiseVec[0] + noiseVec[1] + noiseVec[2] + noiseVec[3]) / 4.0; \n" " if(intensity < uStep) \n" " gl_FragColor = vec4(0.1, 0.1, 0.1, 1.0); \n" " else \n"