Add spot.png to global composer renderer. why? because i want to use photoshop blend shader deal the image.
var texture = new THREE.TextureLoader().load( `./effect.png` );
THREE.CustomShader = {
uniforms: {
"tDiffuse": { value: null },
"u_texture": { value: texture },
"u_resolution" :{ value: new THREE.Vector2() }
},
vertexShader: [
"varying vec2 vUv;",
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader:`
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D tDiffuse;
uniform sampler2D u_texture;
uniform float u_time;
void main(){
vec2 uv = gl_FragCoord.xy / u_resolution.xy;
gl_FragColor = texture2D( u_texture, uv );
}
`
};
But i just can see the black screen? how to do this? THX.