Hello I am teaching myself three js (currently using r150) so that I can prepare a 3d portfolio website for my car designs. When I export a car model from blender, I will name certain parts as lightsFront_glow or lightsRear_glow for example and then apply selective blooming to these parts so that I can mimic the glow of front and rear lights.
I have noticed that selective blooming is something that people are struggling with (me included). However, I understand that selective blooming can be done without the use of layers thanks to @drcmda ‘s helpful comments hereand here.
To test this method, I apply it on a test cube which I try to glow in Red. Heres a snippet of the code based on @drcmda 's tips:
const target = new THREE.WebGLRenderTarget(window.innerWidth,window.innerHeight, {
type: THREE.HalfFloatType,
format: THREE.RGBAFormat,
encoding: THREE.sRGBEncoding,
})
target.samples = 8
const renderScene = new RenderPass( scene, camera );
const bloomPass = new UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), 1, 1, 1 ); // strength, radius ,threshold
composer = new EffectComposer( renderer );
composer.addPass( renderScene );
composer.addPass( bloomPass );
//test cube
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const cube = new THREE.Mesh( geometry,
new THREE.MeshStandardMaterial({
toneMapped: false,
emissive: "red",
emissiveIntensity: 10
})
);
cube.position.y = 1;
cube.position.x = 3;
cube.castShadow = true;
scene.add( cube );
The result doesnt look good though. I’ve included screenshots of how it looks while also changing the tonemapping and HDR options. Any ideas what could be the issue? let me know if i should upload more information which could help the troubleshooting process. I appreciate anyones help
note: the scene goes dark is i turn off HDR maps since theres no other light source in the scene.