- );
-
- std::string fragmentShaderWithFakedShadow = DALI_COMPOSE_SHADER(
- if( vTexCoord.y > sTextureRect.q || vTexCoord.y < sTextureRect.t || vTexCoord.x > sTextureRect.p )\n
- texel = vec4(0.0,0.0,0.0,vEdgeShadow);
- else \n
- );
-
- std::string fragmentShaderPartTwo = DALI_COMPOSE_SHADER(
- { \n
- // display page content
- // display back image of the page, flip the texture
- if( dot(vPosition.xyz, normal) > 0.0 ) texel = texture2D( sTexture, vec2( sTextureRect.p+sTextureRect.s-vTexCoord.x, vTexCoord.y ) );\n
- // display front image of the page
- else texel = texture2D( sTexture, vTexCoord );\n
- // display book spine, a stripe of shadowed texture
- float pixelPos = (vTexCoord.x-sTextureRect.s)*uPageSize.x; \n
- if(pixelPos < uSpineShadowParameter.x) \n
- {\n
- float x = pixelPos - uSpineShadowParameter.x;\n
- float y = sqrt( uSpineShadowParameter.x*uSpineShadowParameter.x - x*x);\n
- spineShadowCoef = normalize( vec2( uSpineShadowParameter.y*x/uSpineShadowParameter.x, y ) ).y;\n
- }\n
- }\n
- // calculate the lighting
- // set the ambient color as vec3(0.4);
- float lightColor = abs( normal.z ) * 0.6 + 0.4;\n
- gl_FragColor = vec4( ( spineShadowCoef* lightColor)* texel.rgb , texel.a ) * uColor;\n
+ // display page content
+ // display back image of the page, flip the texture
+ if( dot(vPosition.xyz, normal) > 0.0 ) texel = texture2D( sTexture, vec2( sTextureRect.p+sTextureRect.s-vTexCoord.x, vTexCoord.y ) );\n
+ // display front image of the page
+ else texel = texture2D( sTexture, vTexCoord );\n
+ // display book spine, a stripe of shadowed texture
+ float pixelPos = (vTexCoord.x-sTextureRect.s)*uPageSize.x; \n
+ if(pixelPos < uSpineShadowParameter.x) \n
+ {\n
+ float x = pixelPos - uSpineShadowParameter.x;\n
+ float y = sqrt( uSpineShadowParameter.x*uSpineShadowParameter.x - x*x);\n
+ spineShadowCoef = normalize( vec2( uSpineShadowParameter.y*x/uSpineShadowParameter.x, y ) ).y;\n
+ }\n
+ // calculate the lighting
+ // set the ambient color as vec3(0.4);
+ float lightColor = abs( normal.z ) * 0.6 + 0.4;\n
+ gl_FragColor = vec4( ( spineShadowCoef* lightColor)* texel.rgb , texel.a ) * uColor;\n