<p>This effect is called <a href="https://en.wikipedia.org/wiki/Bloom_(shader_effect)" rel="noreferrer">light bloom</a>. Its algorithm is usually a variation of the following:</p>

<ol>
<li>Render your scene (preferably in high dynamic range) to texture.</li>
<li>Make a thresholding pass to another texture. I.e. pixels whose brightness is below a certain (configurable) threshold are are turned down to black.</li>
<li>Downsample and blur the thresholded pixels. Usually, this is done in several "octaves", i.e. rendering a Gaussian blur with a small kernel to progressively smaller render targets: from full resolution to half resolution, from half to quarter etc.</li>
<li>Composite the downsampled octaves back onto the scene image.</li>
</ol>

<p>Both the number of octaves used and the Gaussian blur kernel size affect the end result in terms of visual quality and performance, so you may need to do trade-offs.</p>

<p>In other words, the glow effect that you seek is usually simply the original scene image, but thresholded and blurred, superimposed back onto the scene image.</p>

CC BY-SA 3.0
2016-11-04T05:56:49.953Z
Would you know of any online tutorials that do this?
Arjan Singh
CC BY-SA 3.0
2016-11-04T08:31:54.987Z
@ArjanSingh The UE4 source code has examples of how to do this exact method.
Syntac_
CC BY-SA 3.0
2016-11-04T09:09:22.000Z
It's a bit more complicated in UE4 because it also generates lens flares, and the shader system requires some engine know-how to understand, but yeah, `AddBloom()` [here](http://tinyurl.com/hswdnqg) is a good starting point. However, for a super-simple technique that involves an optional "lens dirt" effect, you could check out the post-processing library I wrote back at university: [the CPU side](http://tinyurl.com/zoclj9k) (lines 222-241) and the [bright pass](http://tinyurl.com/zjt3lgh) and [compositing](http://tinyurl.com/jdjdwrw) shaders. Apologies for TinyURL, comment was too long.
IneQuation
CC BY-SA 3.0
2016-11-04T09:20:08.297Z
Also, [this blogpost](https://extremeistan.wordpress.com/2014/09/24/physically-based-camera-rendering/) is a pretty cool resource for camera effects such as this. It links to [Intel's tutorial](https://software.intel.com/en-us/articles/compute-shader-hdr-and-bloom) on the subject, with compute shaders in mind, for instance.
IneQuation
CC BY-SA 3.0
2016-11-03T09:10:03.203Z
2016-11-03T09:10:03.203Z
IneQuation
<p>How can I make an object give the effect that it is giving out light when it isn't? <strong>I basically want to make an object glow</strong>, for example Neon Lights. Also Area Lights in my engine work properly but to increase how realistic it looks I wanted to give the effect of a haze or glow rather than a flat white rectangle/disk.</p>

<p>This photo basically shows what I want to do perfectly.</p>

<p><a href="https://i.sstatic.net/09CkX.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/09CkX.jpg" alt="enter image description here"></a></p>

<opengl><lighting><directx11>
Bloom in DirectX
Arjan Singh
# Bloom in DirectX

(Asked by: username_0 on 2016-11-03)

How can I make an object give the effect that it is giving out light when it isn't? **I basically want to make an object glow**, for example Neon Lights. Also Area Lights in my engine work properly but to increase how realistic it looks I wanted to give the effect of a haze or glow rather than a flat white rectangle/disk.

This photo basically shows what I want to do perfectly.

[![enter image description here](https://i.sstatic.net/09CkX.jpg)](https://i.sstatic.net/09CkX.jpg)

**Tags:** opengl, lighting, directx11


---

## 1 answers

### Answer by username_1 on 2016-11-03. Score: 7 | Accepted answer

This effect is called [light bloom](https://en.wikipedia.org/wiki/Bloom_(shader_effect)). Its algorithm is usually a variation of the following:

1. Render your scene (preferably in high dynamic range) to texture.
2. Make a thresholding pass to another texture. I.e. pixels whose brightness is below a certain (configurable) threshold are are turned down to black.
3. Downsample and blur the thresholded pixels. Usually, this is done in several "octaves", i.e. rendering a Gaussian blur with a small kernel to progressively smaller render targets: from full resolution to half resolution, from half to quarter etc.
4. Composite the downsampled octaves back onto the scene image.

Both the number of octaves used and the Gaussian blur kernel size affect the end result in terms of visual quality and performance, so you may need to do trade-offs.

In other words, the glow effect that you seek is usually simply the original scene image, but thresholded and blurred, superimposed back onto the scene image.

> **Comments:**
> **username_0**: Would you know of any online tutorials that do this?  
> **username_2**: @username_0 The UE4 source code has examples of how to do this exact method.  
> **username_1**: It's a bit more complicated in UE4 because it also generates lens flares, and the shader system requires some engine know-how to understand, but yeah, `AddBloom()` [here](http://tinyurl.com/hswdnqg) is a good starting point. However, for a super-simple technique that involves an optional "lens dirt" effect, you could check out the post-processing library I wrote back at university: [the CPU side](http://tinyurl.com/zoclj9k) (lines 222-241) and the [bright pass](http://tinyurl.com/zjt3lgh) and [compositing](http://tinyurl.com/jdjdwrw) shaders. Apologies for TinyURL, comment was too long.  
> **username_1**: Also, [this blogpost](https://extremeistan.wordpress.com/2014/09/24/physically-based-camera-rendering/) is a pretty cool resource for camera effects such as this. It links to [Intel's tutorial](https://software.intel.com/en-us/articles/compute-shader-hdr-and-bloom) on the subject, with compute shaders in mind, for instance.  

---

