#endif
#ifdef IS_REQUIRED_BLUR
+#ifdef GLSL_VERSION_1_0
+// Legacy code for low version glsl
+mediump float calculateBlurOpacity()
+{
+ highp float potential = gPotential;
+
+ highp float alias = min(gRadius, 1.0);
+ highp float potentialMin = gMinOutlinePotential - blurRadius - alias;
+ highp float potentialMax = gMaxOutlinePotential + blurRadius + alias;
+
+ return 1.0 - smoothstep(potentialMin, potentialMax, potential);
+}
+#else
mediump float calculateBlurOpacity()
{
// Don't use borderline!
return 1.0 - smoothstep(potentialMin, potentialMax, potential);
}
#endif
+#endif
void main()
{
// If we use blur, just ignore borderline
borderline = false;
shaderTypeFlag |= ColorVisualRequireFlag::BLUR;
-
- // If shader version doesn't support blur with corner radius, ignore corner radius
- if(DALI_UNLIKELY(Dali::Shader::GetShaderLanguageVersion() < MINIMUM_SHADER_VERSION_SUPPORT_ROUNDED_BLUR))
- {
- roundedCorner = false;
- }
}
if(roundedCorner)
{
vertexShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
}
+
+ // If shader version doesn't support blur with corner radius, Let we use legacy code.
+ if(DALI_UNLIKELY(Dali::Shader::GetShaderLanguageVersion() < MINIMUM_SHADER_VERSION_SUPPORT_ROUNDED_BLUR))
+ {
+ fragmentShaderPrefixList += "#define GLSL_VERSION_1_0\n";
+ }
+
shader = Shader::New(Dali::Shader::GetVertexShaderPrefix() + vertexShaderPrefixList + SHADER_COLOR_VISUAL_SHADER_VERT.data(),
Dali::Shader::GetFragmentShaderPrefix() + fragmentShaderPrefixList + SHADER_COLOR_VISUAL_SHADER_FRAG.data());
mFactoryCache.SaveShader(shaderType, shader);