I'm interested in experimenting with ShaderMaterial from Three.js, but I am not familiar with the OpenGL Shading Language. When I try to use the fragment shader code from the website mentioned above, I encounter a number of errors. I'm unsure if the vertex and fragment shaders are dependent on each other or if it doesn't matter. If they are connected, what should I include in the vertex shader? Thank you.
uniform float time;
varying vec2 vUv;
varying vec2 surfacePosition;
uniform vec2 resolution;
void main()
{
vec3 posChanged = position;
posChanged.x = posChanged.x*(abs(sin(time*1.0)));
posChanged.y = posChanged.y*(abs(cos(time*1.0)));
posChanged.z = posChanged.z*(abs(sin(time*1.0)));
gl_Position = projectionMatrix * modelViewMatrix * vec4(posChanged,1.0);
}
I would like to implement the fragment shader from this glslsandbox.com