It worked in C2 webGL effect preview, but it didn't work in runtime.
it appears an error
<img src="http://i.imgur.com/H7Jjcsz.png" border="0" />
There is my .fx
#ifdef GL_ES
precision highp float;
#endif
uniform float p;
uniform float amount;
uniform float seed;
uniform float lines;
uniform lowp sampler2D sampleFront;
varying vec2 position;
float rand(vec2 co){
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
void main( void ) {
float y = floor(lines*position.y)/lines;
float disf = 0.01*(cos(position.y*130.+p*10.)+sin(position.y*183.+p*80.));
float parity = 0.; if(mod(y*lines, 2.)>0.5) parity=1.; else parity=-1.;
float a = smoothstep(0., 1.0, p);
position.x = amount*a*(y*0.3+disf)+position.x+
amount*0.5*parity*smoothstep(0.6, 0.65, p)*(sin(position.y*(12.+40.*seed))+smoothstep(0.64, 0.65, p));
vec4 colorInput = texture2D( sampleFront, position );
gl_FragColor = colorInput;
}
How to fix it?