# How to create outline material with forward shading?

**URL:** <https://forums.unrealengine.com/t/how-to-create-outline-material-with-forward-shading/1297526>\
**Category:** Rendering\
**Tags:** Forward-Rendering, unreal-engine, question\
**Created:** [September 15, 2023, 5:38pm UTC](https://forums.unrealengine.com/t/how-to-create-outline-material-with-forward-shading/1297526 "2023-09-15T17:38:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Texn0krat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Texn0krat](https://forums.unrealengine.com/u/Texn0krat)\
**Post date:** [September 15, 2023, 5:38pm UTC](https://forums.unrealengine.com/t/how-to-create-outline-material-with-forward-shading/1297526/1 "2023-09-15T17:38:00Z")

</div>

Good evening. I’m trying to switch from deffered to forwatd shading and it looks like there are a problems with post process shaders. I’m trying to re-create outline shader. I found 2 ways to achieve that:

1. [https://www.youtube.com/watch?v=Ptuw9mxekh0](https://www.youtube.com/watch?v=Ptuw9mxekh0) the guy is getting cool effect like this  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/b/bab2f560fda0704f235599c6a95e97b0b4db6cb9.jpeg)  
but for me it’s looking like this:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/3/f/c3ff36aa4087981567bfa4d800b4f8d3511917c7.jpeg)  
and error  
_"GPU Crashed or D3D Device Removed._  
_Use -d3ddebug to enable the D3D debug device._  
_Check log for GPU state information."_  
so I don’t know how to make it look good and how to use it as mask to get only outlines
2. 

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/3/da36f416ebe5fe110cbfc217b22c65381faf9e41.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/b/22b0d0fd79351dd4653e775ffcd144f525e803d0.png)  
This material can give good result but all the lines can be seen through the walls  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/7/8675639ee9902febafd261b8b604abd855cc88c7.jpeg)  
and it look much worse than original PP material I’ve used for outlines:

> **[PP\_Outlines posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/71iebpur/)**
>
> No description provided

Is there a good way to achieve outline effect with forward shading or ways to improve materials I’ve mentioned?
