# Blurring certain stencil buffers for outlines

**URL:** <https://forums.unrealengine.com/t/blurring-certain-stencil-buffers-for-outlines/450761>\
**Category:** Rendering\
**Tags:** Post-Processing, outline, glow, unreal-engine, blur, question\
**Created:** [June 16, 2019, 10:09am UTC](https://forums.unrealengine.com/t/blurring-certain-stencil-buffers-for-outlines/450761 "2019-06-16T10:09:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Visor90](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Visor90](https://forums.unrealengine.com/u/Visor90)\
**Post date:** [June 16, 2019, 10:09am UTC](https://forums.unrealengine.com/t/blurring-certain-stencil-buffers-for-outlines/450761/1 "2019-06-16T10:09:45Z")

</div>

I’m trying to create/customise a material for multi-color soft outlines on meshes, but with my own specific set of occlusion rules and per-stencil settings.

I’m using [Tom Looman’s Local Outlines](https://www.tomlooman.com/ue4-local-outlines/) as my base material. Its main selling point is the fact that it doesn’t use postprocessing, instead relying on translucent surrounding meshes, e.g. a cube or a sphere. This leads to some performance gains.

I’ve used the spiral blur HLSL code from [here](https://ferkizue.blogspot.com/2018/10/multicolor-soft-outline-in-unreal-engine.html) (courtesy of Zuzana Ferková), which in turn is based on [this](https://www.tomlooman.com/soft-outlines-in-ue4/) (by Tom Looman). The results are promising, however, I’m lacking the ability to choose, which stencils are affected by the blur. The code in question doesn’t discriminate between any stencil indexes and affects each and all of them.

How would I go about implementing a filter in order to affect only certain stencils? Any help would be appreciated!
