Selective Bloom: Question about different results on different browsers #559
Replies: 3 comments 1 reply
-
This might be relevant: #496 (comment) |
Beta Was this translation helpful? Give feedback.
-
I recently got in contact with @lviggiani to discuss this topic, but we couldn't find the reason why I am getting different results on firefox. So now I created a simple scene to try and find the issue, I would appreciate if people from the community would give me feedback on their thoughts and observations. The scene has to cubes: one green non-blooming cube and one red blooming cube. The bottom half of the scene is covered by a glass plane. This mimics the scenario of rendering the brake lights of a car. ` //Imports for pmndrs post processing library import { // // // // // Create scene // // // // // Create glass cover // // // // // Create red cube (GLOWING) // // Glowing Material: Color Method // // Glowing Material: Emissive Method const redCube = new THREE.Mesh(redGeometry, redMaterial); // // // // // Create green cube (NON-GLOWING) // // // // // Create camera // // // // // Create renderer // // // // // Create Effects // // Bloom bloomEffect.selection.add(redCube); // Try adding this line // // Tone-Mapping const TMeffectPass = new EffectPass(camera, TMeffect); // // // // // Create Composer composer.addPass(new RenderPass(scene, camera)); // // // // // Animation function // Rotate cubes composer.render(scene, camera); // Handle window resize camera.aspect = newWidth / newHeight; composer.setSize(newWidth, newHeight); // Start animation |
Beta Was this translation helpful? Give feedback.
-
Bloom is a blur effect that is applied to the final rendered scene. There is no concept of "passing through" since it's an image effect. Results entirely depend on your rendered scene which serves as the baseline. If you have a red light (emissive mesh or point light) behind a glass object, the red colors should be visible in the rendered scene. If these color values are higher than the bloom threshold, they'll be blurred. If this is not working, then the red light is not being rendered correctly. Another possibility is that your test device doesn't support high precision frame buffers.
If that is not the case with a certain setup, please create a bug report with a simplified reproduction of the issue. |
Beta Was this translation helpful? Give feedback.
-
Hello :) In my scene, I have loaded an hdri and a model of a car. Id like to implement selective bloom in order to mimic the glow of the brake lights. I added the inner red bulb mesh to the bloom effect using the following line:
bloomEffect.selection.add(lights_rear_bulb);
and bloom was setup up as follows:
const bloomEffect = new SelectiveBloomEffect(scene, camera, { intensity: 10, mipmapBlur: true, luminanceThreshold: 0, luminanceSmoothing: 0.25, radius: 0.2, resolutionScale: 4, });
This allowed the object to bloom but I noticed that the whole HDRI background is blooming like crazy. I did some digging and people proposed that I increase the threshold to a high value, and then push colors on materials I want to bloom over the threshold. So that’s what I did, heres the material of the brake lights which I assign to the mesh “lights_rear_bulb”
const brakeLightMaterial = new THREE.MeshBasicMaterial( { toneMapped: false, color: new THREE.Color().setRGB(400, 0, 0) });
And heres the setup of the bloom:
const bloomEffect = new SelectiveBloomEffect(scene, camera, { intensity: 10, mipmapBlur: true, luminanceThreshold: 50, luminanceSmoothing: 0.25, radius: 0.2, resolutionScale: 4, });
So the threshold is 50, but I noticed that if I push the red color to 51 or 60, no bloom was happening, only until I reached 400. My first question would be if there is any other recommended method of achieving what im trying to achieve: basically, having bloom ONLY for the mesh “lights_rear_bulb”
My second question has to do with the fact that im getting different results on different browsers. The mesh “lights_rear_bulb” is behind a mesh called “lights_rear_glass” which represents the glass cover of the rear lights. The bloom effect passes through it when I use Chrome or Edge, but it gets blocked when I use Firefox. Any idea whats happening there? Is there other big differences I should be aware of when it comes to these popular browsers?
Beta Was this translation helpful? Give feedback.
All reactions