I recently started learning about shaders and three.js. I tried to display a shader with a texture but it displays all black.
Here's the codepen: https://codepen.io/LDB95/pen/MxmWNq
These are my uniforms:
uniforms: {
tDiffuse: { value: null },
time: { type: "f", value: 1.0 },
resolution: { type: "v2", value: new THREE.Vector2() },
iChannel0: { type: 't', value: new THREE.TextureLoader().load('https://naqyr37xcg93tizq734pqsx1-wpengine.netdna-ssl.com/wp-content/uploads/2017/11/10-Things-We-Can-Learn-From-the-Incredible-Steve-Jobs.jpg')},
iChannel1: { type: 't', value: new THREE.TextureLoader().load('https://gobelmont.ca/Portals/0/xBlog/uploads/2018/8/30/white%20noise.jpg')},
},
I just can't seem to find the fix. Would be really awesome if someone could help me out here :)
Thanks!
RenderTargets, so the EffectComposer and ShaderPass in the examples might be outdated. For simplicity's sake, you should just import Three.js version 100 for now, until those examples are updated. Additionally, if you look at your console, you're getting aCross-Origin Request Blockedwarning. Your images are not being loaded. You should do a search on what that warning means to find out how to fix it.