- );
-
- std::string vertexShaderWithFakedShadow = DALI_COMPOSE_SHADER(
- // display shadow, the fake shadow value is calculated according to the height and the distance from page edge
- vTexCoord.x = (aTexCoord.x-sTextureRect.s) /( 1.0 - uShadowWidth ) + sTextureRect.s;\n
- vTexCoord.y = ( aTexCoord.y-sTextureRect.t-0.5*uShadowWidth*(sTextureRect.q-sTextureRect.t) )/( 1.0 - uShadowWidth ) + sTextureRect.t;\n
- float heightCoef = (1.0 + position.z*uIsTurningBack*3.0 / uPageSize.x) * 0.6;
- vEdgeShadow = clamp(0.9 - heightCoef, 0.0, 0.9 ); \n
- if( vTexCoord.y >= sTextureRect.q || vTexCoord.y <= sTextureRect.t || vTexCoord.x >= sTextureRect.p )\n
- {\n
- float inversedShadowWidth = (1.0-uShadowWidth) / uShadowWidth ;\n
- float alpha1 = (vTexCoord.x-sTextureRect.p) * inversedShadowWidth / (sTextureRect.p - sTextureRect.s);\n
- inversedShadowWidth = 2.0 * inversedShadowWidth / (sTextureRect.q - sTextureRect.t); \n
- float alpha2 = (vTexCoord.y-sTextureRect.q) * inversedShadowWidth;\n
- float alpha3 = (sTextureRect.t-vTexCoord.y) * inversedShadowWidth;\n
- float alpha;\n
- if(alpha1 > 0.0 && alpha2 > 0.0) alpha = sqrt(alpha2*alpha2+alpha1*alpha1)/sqrt(1.0 + max(alpha1,alpha2)*max(alpha1,alpha2));\n //bottom-right corner
- else if(alpha1 > 0.0 && alpha3 > 0.0) alpha = sqrt(alpha3*alpha3+alpha1*alpha1)/sqrt(1.0+max(alpha1,alpha3)*max(alpha1,alpha3));\n //top-right corner
- else alpha = max(alpha1,max(alpha2,alpha3)); \n
- alpha = 0.9 - alpha*0.9;\n
- vEdgeShadow = clamp(alpha - heightCoef, 0.0, 0.9 ); \n