-
-
Save michaelperros/ad03a8a6cae574fad3a1fb9c97d23796 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| varying vec2 vUv; | |
| void main() { | |
| vec3 texture = texture2D(uTexture, vUv).rgb; | |
| gl_FragColor = vec4(texture, 1.0); | |
| } | |
| ' | |
| ) | |
| extend({ WaveShaderMaterial }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment