"varying" parameter in shaders
Posted: Wed Apr 15, 2015 1:31 pm
Hi guyz!
Long time i can't understand why some shaders not working... and i found the reason at least in my case!
There's problem with "varying" parameter - MMV can't use it or i do smth wrong?
Long time i can't understand why some shaders not working... and i found the reason at least in my case!
There's problem with "varying" parameter - MMV can't use it or i do smth wrong?
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
varying vec2 surfacePosition;
uniform vec2 mouse;
void main( void ) {
vec2 pos = vec2(0,0);
vec3 color = vec3(1,1,1);
float dist = 0.5+0.5*cos(mouse.x*-20.0+300.0*pow(max(0.01,distance(pos,surfacePosition)),0.1));
gl_FragColor = vec4(color * dist, 1.0);
}