Rendering the scene multiple times with different objects is the wrong approach, since you’ll lose control over object sorting; ergo, metaphorically you’re just rendering two layers on top of each other.
If you want selective bloom, I’d recommend writing your own solution that utilizes sRGB color space, so only emissive materials emit bloom.
You’d want several effect passes for this (in order):
Render pass (or copy pass), somewhere to store the current scene in a render-target. You’ll need this (copy of your scene) to feed to the next pass.
Feature generation (strip out everything that has a color value below 1). You’ll now have a render-target with just the “highlights” of your scene.
This pass has one input: the result of the previous iteration, starting with the feature generation pass that solely contains the highlights that are currently in view, then the result of the previous iteration. You’ll want to run this one recursively for about 13 times, in which you split the resolution in half each time. (it’s somewhat what Unity does). Just use bilinear filtering for the least resource intensive option, or go with the h/v-blur shares that THREE provides for higher quality bloom. Make sure to ADD the original input with the output color (additive blending in the same shader preferably).
Blend the final result of the last pass from the previous step with the original scene in step 1.
Now you’ll have full control over which parts should emit bloom and which shouldn’t by simply applying an emissive map to any object or material and playing around with the material’s emissive value.
THREE.ColorManagement.legacyMode = false
...
renderer.outputEncoding = THREE.sRGBEncoding
renderer.toneMapping = THREE.ACESFilmicToneMapping
...
const target = new THREE.WebGLRenderTarget(width, height, {
type: THREE.HalfFloatType,
format: THREE.RGBAFormat,
encoding: THREE.sRGBEncoding,
})
target.samples = 8
const composer = new EffectComposer(renderer, target)
composer.addPass(new RenderPass(scene, camera))
composer.addPass(new ShaderPass(GammaCorrectionShader))
// Setting threshold to 1 will make sure nothing glows
composer.addPass(new UnrealBloomPass(undefined, 1, 1, 1))
// This mesh will glow because emissive leaves 0-1 range, everything else won't
const mesh = new THREE.Mesh(
geometry,
new THREE.MeshStandardMaterial({
toneMapped: false,
emissive: "red",
emissiveIntensity: 10
in essence selection is already inbuilt in the bloom effect, there is nothing you need to do. just set threshold to 1, and every material that goes beyond 0-1 spectrum will glow.