I used shadermaterial to create a material. When adding objects to the scene, it will mask the unrealboom effect. This is my material code.
this.material = new THREE.ShaderMaterial({
uniforms: {
'color': {
type: 'c',
value: new THREE.Color(this.options.color)
},
'texture0': {
type: 't',
value: texture
},
'iTime': {
type: 'f',
value: 0
}
},
vertexShader: `
#include <common>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
varying vec2 vUv;
varying vec3 vNomal;
void main() {
vUv = uv;
vNomal = normal;
vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
vec4 mvPosition = viewMatrix * worldPosition;
gl_Position = projectionMatrix * mvPosition;
#include <logdepthbuf_vertex>
#include <fog_vertex>
}
`,
fragmentShader: `
#include <common>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
uniform sampler2D texture0;
uniform vec3 color;
uniform float iTime;
varying vec2 vUv;
varying vec3 vNomal;
void main() {
#include <logdepthbuf_fragment>
float opacity = 1.;
vec4 map = texture2D(texture0, vec2(vUv.x, vUv.y+iTime));
vec4 muti = vec4(color, opacity) * map;
if(abs(vNomal.y) > 0.95){
muti = vec4(color, 0.);
}
gl_FragColor = muti;
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
}
`,
transparent: true,
side: 2,
depthWrite: false
})