- // Create the implementation, temporarily owned on stack,
- Dali::ShaderEffect shaderEffectCustom;
- std::ostringstream vertexShaderStringStream;
- std::ostringstream fragmentShaderStringStream;
- if( enableBlending )
- {
- vertexShaderStringStream<< vertexShader << vertexShaderWithFakedShadow << vertexShaderEnd;
- fragmentShaderStringStream<< fragmentShaderPartOne << fragmentShaderWithFakedShadow << fragmentShaderPartTwo;
- shaderEffectCustom = Dali::ShaderEffect::New( vertexShaderStringStream.str(), fragmentShaderStringStream.str(),
- ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_DEPTH_BUFFER | ShaderEffect::HINT_BLENDING) );
- }
- else
- {
- vertexShaderStringStream<< vertexShader << vertexShaderEnd;
- fragmentShaderStringStream<< fragmentShaderPartOne << fragmentShaderPartTwo;
- shaderEffectCustom = Dali::ShaderEffect::New( vertexShaderStringStream.str(), fragmentShaderStringStream.str(),
- ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_DEPTH_BUFFER ) );
- }
-
- static const float DEFAULT_SHADOW_WIDTH(0.15f);
- static const Vector2 DEFAULT_SPINE_SHADOW_PARAMETER(50.0f, 20.0f);
-
- Vector2 defaultPageSize = Dali::Stage::GetCurrent().GetSize();
- Dali::Matrix zeroMatrix(true);
- shaderEffectCustom.SetUniform( "uCommonParameters", zeroMatrix );
- shaderEffectCustom.SetUniform( "uPageSize", defaultPageSize/(1.f-DEFAULT_SHADOW_WIDTH) );
- shaderEffectCustom.SetUniform( "uShadowWidth", DEFAULT_SHADOW_WIDTH );
- shaderEffectCustom.SetUniform( "uSpineShadowParameter", DEFAULT_SPINE_SHADOW_PARAMETER );