Hi, I’m using transformController and Unreal Bloom shader in my custom editor.
I met problem that I can’t except transform controller by selective bloom.
In other word I have to use transform controller with Bloom effect.
That is okay but the main problem is If I hover XZ plane, the whole screen goes bright yellow as you can see below
before hover
after hover
sorry for your eyes…
I made selective bloom this way
function renderBloom() {
const originBackGround = scene.background;
scene.background = darkMaterial.color;
scene.traverse(darkenNonBloomed);
bloomComposer.render();
scene.traverse(restoreMaterial);
scene.background = originBackGround;
}
function darkenNonBloomed(obj: THREE.Object3D) {
if (!bloomLayer.test(obj.layers) === true) {
if (
obj instanceof THREE.Mesh ||
obj instanceof THREE.GridHelper ||
obj instanceof THREE.BoxHelper ||
obj instanceof THREE.Sprite
) {
if (obj.material) {
materials[obj.uuid] = obj.material;
obj.material = darkMaterial;
}
}
}
}
function restoreMaterial(obj: THREE.Object3D) {
if (
(obj instanceof THREE.Mesh ||
obj instanceof THREE.GridHelper ||
obj instanceof THREE.BoxHelper ||
obj instanceof THREE.Sprite) &&
materials[obj.uuid]
) {
obj.material = materials[obj.uuid];
delete materials[obj.uuid];
}
}