Topic: Maratis shader syntax question?
Hi, im learning glsl. I want to create a water ripple on the plane, but in maratis it looks just white color. Can someboady tell me whats wrong with this code:
VERT shader
attribute vec3 Vertex;
//attribute vec3 Color;
uniform mat4 ProjModelViewMatrix;
void main()
{
gl_Position = ProjModelViewMatrix * vec4(Vertex, 1.0);
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
FRAG shader
uniform float time;
uniform sampler2D Texture[8];
float radius = .5;
void main()
{
float t = clamp(time / 6., 0., 1.);
vec2 coords = gl_TexCoord[0].st;
vec2 dir = coords - vec2(.5);
float dist = distance(coords, vec2(.5));
vec2 offset = dir * (sin(dist * 80. - time*15.) + .5) / 30.;
vec2 texCoord = coords + offset;
vec4 diffuse = texture2D(Texture[0], texCoord);
//vec4 mixin = texture2D(Texture[1], texCoord);
gl_FragColor = diffuse * (1. - t);
}