Skip to content

Instantly share code, notes, and snippets.

@michaelperros
Forked from eriksachse/material.js
Created August 25, 2024 02:57
Show Gist options
  • Save michaelperros/ad03a8a6cae574fad3a1fb9c97d23796 to your computer and use it in GitHub Desktop.
Save michaelperros/ad03a8a6cae574fad3a1fb9c97d23796 to your computer and use it in GitHub Desktop.

Revisions

  1. @eriksachse eriksachse revised this gist Apr 10, 2022. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion material.js
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,6 @@ const WaveShaderMaterial = shaderMaterial(
    precision mediump float;
    uniform float uTime;
    uniform sampler2D uTexture;
    uniform vec3 uColor;
    varying vec2 vUv;
    void main() {
    vec3 texture = texture2D(uTexture, vUv).rgb;
  2. @eriksachse eriksachse created this gist Apr 10, 2022.
    25 changes: 25 additions & 0 deletions material.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    const WaveShaderMaterial = shaderMaterial(
    // uniforms
    { uTime: 0, uTexture: new THREE.Texture() },
    // vertex
    glsl'
    varying vec2 vUv;
    void main() {
    vUv = uv;
    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
    }
    ',
    // fragment
    glsl'
    precision mediump float;
    uniform float uTime;
    uniform sampler2D uTexture;
    uniform vec3 uColor;
    varying vec2 vUv;
    void main() {
    vec3 texture = texture2D(uTexture, vUv).rgb;
    gl_FragColor = vec4(texture, 1.0);
    }
    '
    )
    extend({ WaveShaderMaterial })