Shader does not compile with latest Nvidia driver on Ubuntu as we did not set the default precision
and used an f at the end of a float in the shader. Other shader compilers are more permissive so
this was not spotted before.
Change-Id: I235b901f08a73086b8b581a8c40bb4ed517ba35d
static NoEffect New()
{
std::string vertexShader = MAKE_SHADER(
static NoEffect New()
{
std::string vertexShader = MAKE_SHADER(
+ precision mediump float;\n
uniform mediump vec4 uTextureRect;\n
void main()\n
{\n
uniform mediump vec4 uTextureRect;\n
void main()\n
{\n
}\n
);
std::string fragmentShader = MAKE_SHADER(
}\n
);
std::string fragmentShader = MAKE_SHADER(
+ precision mediump float;\n
void main()\n
{\n
gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
void main()\n
{\n
gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
static RefractionEffect New()
{
std::string vertexShader = MAKE_SHADER(
static RefractionEffect New()
{
std::string vertexShader = MAKE_SHADER(
+ precision mediump float;\n
varying mediump vec2 vTextureOffset;\n
void main()\n
{\n
varying mediump vec2 vTextureOffset;\n
void main()\n
{\n
);
std::string fragmentShader = MAKE_SHADER(
);
std::string fragmentShader = MAKE_SHADER(
+ precision mediump float;\n
uniform mediump float uEffectStrength;\n
uniform mediump vec3 uLightPosition;\n
uniform mediump vec2 uLightXYOffset;\n
uniform mediump float uEffectStrength;\n
uniform mediump vec3 uLightPosition;\n
uniform mediump vec2 uLightXYOffset;\n
{\n
vec3 normal = normalize( vNormal);\n
{\n
vec3 normal = normalize( vNormal);\n
- vec3 lightPosition = uLightPosition + vec3(uLightXYOffset+uLightSpinOffset, 0.f);\n
+ vec3 lightPosition = uLightPosition + vec3(uLightXYOffset+uLightSpinOffset, 0.0);\n
mediump vec3 vecToLight = normalize( (lightPosition - vVertex.xyz) * 0.01 );\n
mediump float spotEffect = pow( max(0.05, vecToLight.z ) - 0.05, 8.0);\n
mediump vec3 vecToLight = normalize( (lightPosition - vVertex.xyz) * 0.01 );\n
mediump float spotEffect = pow( max(0.05, vecToLight.z ) - 0.05, 8.0);\n