In Babylon.js, I was using a GlowLayer to prettify the glowing effect on my material. It is applied on the emissive map/emissive color and not on the color map/base color. So for example, if you want a drawing to glow on your color map, it can be done:
However, I tried few things in Three.js to obtain this, but never met success
I was wondering if there is a way to do so?
Also, I am adding/removing elements interactively in Vue, by watching the computed values when changed and calling methods from my Babylon/Three scenes to update the scene accordingly ; So if the glowing method can be compatible with that, that would be perfect
(ps, if it makes any difference: Iâm using PBR materials, with MeshStandardMaterial.)
Computer Graphics is all about cheating the human brain. If you want to mimic a ârealâ glowing effect, you can check how it is done in these examples:
The glow in the red shouldnât be there, since the emissive value of the box itself is 0. It may depend on your monitor if the effect is obvious or not, but the feature generation pass that extracts bright colors from the source image should only extract values above 1.0.
In three.js this is managed by the bloom threshold, as shown in this demo. Bloom does not only affect emissive surfaces â a strong light directed at a metallic surface would also give a bloom, for example, the source of the bright light does not matter.
For the case shown above youâd probably want to raise the threshold to around 1, and ensure youâre using a HalfFloatType (default) or FloatType render target for post-processing so input values are not clamped to [0, 1] before bloom.
Oooohh my⊠Now i feel a bit dumb⊠I never thought about metallic reflections or specular highlights in this use-case. That makes a lot of sense! Thanks for the insight
When you comment line 102 the second rendering overwrites the first rendering. So, the glowing within the cube is deleted, and only the glowing outside the cube is left visible.
Hi,
I donât get the key point(s) that make only the emissiveMap glows.
When I try to adapt it to my code, everything glows.
Where should I look specifically in the code, please?
I donât know your setup for EffectComposer and for emissive stuff in material
The main things to look at:
lines 11-16 (settings for WebGLRenderTarget, that passed in super(renderer, target);)
line 20 (const bloomPass = new UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), 0.2, 0.0, 1.01 );, where 1.01 is threshold greater than 1)