UNPKG

macaw-threejs

Version:

Macaw Three.js is ready to use library to connect Three.js with your project.<br/> Under the hood is a fully optimized, clean Three.js set up to make it easy to implement effects for images (future text, etc.). With effects out of the box, you don't even

2 lines (1 loc) 830 B
import{perlinNoise as e}from"../../utils/perlin_noise.js";import{MacawShader as n}from"./index.js";class r extends n{constructor(){super({baseUniforms:{tDiffuse:{value:null},scrollSpeed:{value:0},u_time:{value:0}},baseFragment:{utils:`\n ${e}\n `,uniforms:"\n uniform sampler2D tDiffuse;\n uniform float scrollSpeed;\n uniform float u_time;\n ",varying:"\n varying vec2 vUv;\n ",beforeGl_FragColor:"\n vec2 newUV = vUv;\n ",afterGl_FragColor:"\n gl_FragColor = texture2D(tDiffuse, newUV);\n "},baseVertex:{varying:"\n varying vec2 vUv;\n ",beforeGl_Position:"\n vUv = uv;\n ",afterGl_Position:"\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n "},isImage:!1})}}export{r as MacawComposerShader};