# What does the threshold in unrealbloompass means and how to make a color just pass that threshold a bit? how to calculate the threshold for a color?

what does the threshold mean?

The threshold is the brightness value over which it will start to bloom that color.

The brightness of its color is basically the max of R , G , and B
(its actually a bit more complex than thatâ€¦ IRL but I think this probably assumes max)

Normally colors are in the 0 to 1 rangeâ€¦ but you can set a color higher than 1 on the materialâ€¦

If you then set material.emissiveColor = new THREE.Color(2,1,1) and a threshold of 1â€¦ your object should bloom with red.

The way unrealbloom works, is it takes the input image, and where the brightness value of the pixel is > threshold, it copies those pixels to a new rendertarget, then does a 2 pass gaussian blur on that render targetâ€¦ and then blends that renderdtarget back on top of the original image to create the bloomed image.

2 Likes

what manthrax said is a 100%. for some reason itâ€™s not being used in the official examples. controlling bloom simply with treshold + going outside 0-1 RGB on the materials directly is very easy and doesnâ€™t require any additional work and effect passes or scene traversal. threshold pretty much makes bloom selective ootb.

I see the math algorithm here. Can you explain how the threshold is used there and how to calculate the threshold for a color.

``````luminance = .299 x <red> + .587 x <green> + .114 x <blue>