Code

Three.js

Shader Material

Advanced Custom GLSL vertex and fragment shaders via ShaderMaterial — the vertex shader displaces a plane with sine-wave noise; the fragment shader cycles RGB from vertex position and a uTime uniform. Three.js Docs

const uniforms = { uTime: { value: 0 } };

const material = new THREE.ShaderMaterial({
  uniforms,
  vertexShader: `
    uniform float uTime;
    varying vec3 vPosition;
    void main() {
      vPosition = position;
      vec3 pos = position;
      float wave =
        sin(pos.x * 2.8 + uTime) * 0.22 +
        cos(pos.y * 2.2 + uTime * 0.9) * 0.18;
      pos.z += wave;
      gl_Position =
        projectionMatrix * modelViewMatrix *
        vec4(pos, 1.0);
    }
  `,
  fragmentShader: `
    uniform float uTime;
    varying vec3 vPosition;
    void main() {
      float r = 0.5 + 0.5 * sin(vPosition.x * 1.8 + uTime);
      float g = 0.5 + 0.5 * sin(vPosition.y * 1.8 + uTime * 1.3);
      float b = 0.5 + 0.5 * sin(vPosition.z * 6.0 + uTime * 0.7);
      gl_FragColor = vec4(r, g, b, 1.0);
    }
  `,
  side: THREE.DoubleSide
});

function animate() {
  uniforms.uTime.value += 0.015;
  renderer.render(scene, camera);
  requestAnimationFrame(animate);
}