#version 300 es
in vec4 position;
in vec3 texcoord;
out highp vec2 vTextureCoord;
out highp vec3 vGrainCoord;

uniform highp mat4 texTransform;
uniform highp vec3 grainPos;

void main() {
 gl_Position = position;

 vec4 transCoord = texTransform * vec4(texcoord,1.0);

 vTextureCoord = transCoord.xy;

 vGrainCoord.xy = fract(transCoord.yx * (grainPos.yx*0.07)/128.0);
 vGrainCoord.z = 0.1;

}
