# How to make a thin line material for bounding volumes?

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-thin-line-material-for-bounding-volumes/2339583>\
**Category:** Rendering\
**Tags:** unreal-engine, editor, Rendering, question\
**Created:** [February 17, 2025, 5:19pm UTC](https://forums.unrealengine.com/t/how-to-make-a-thin-line-material-for-bounding-volumes/2339583 "2025-02-17T17:19:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![volumetrix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@volumetrix](https://forums.unrealengine.com/u/volumetrix)\
**Post date:** [February 17, 2025, 5:19pm UTC](https://forums.unrealengine.com/t/how-to-make-a-thin-line-material-for-bounding-volumes/2339583/1 "2025-02-17T17:19:16Z")

</div>

Several objects in UE5 like the post-processing volume and trigger boxes have bounding box visualisation in the editor.

 ![linematerial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/b/bfbca8396cf08d46ab1715ffddfba46431f4c31c.png)

How can such a material be created in the material graph? Or how can this same material be applied to user created primitives?

This only has to work for boxes. Doesn’t have to be smooth or antialiased. Thickness should be constant regardless of viewing distance and angle just like the example.

Attempting this in the pixel shader using UVs works somewhat but scaling reduces the line thickness and ruins the effect.

 ![stretched](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/c/8ec7da913283f3d130c4c661a3fd07a3606b960f.png)

---

<div class="post-metadata">

**Author:** ![MarcoPablo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MarcoPablo](https://forums.unrealengine.com/u/MarcoPablo)\
**Post date:** [March 11, 2025, 4:56pm UTC](https://forums.unrealengine.com/t/how-to-make-a-thin-line-material-for-bounding-volumes/2339583/2 "2025-03-11T16:56:57Z")

</div>

The closest way that I know is to use a post-process material and then enable “Set Render Custom Depth” on the specific mesh you would like to highlight. Attached a video below that goes over how to make the material and apply it via Blueprints

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/d/6ed0b27c6e12f19999eeca221cb77c3f4bdc2bef.jpeg "Unreal Engine City Building Game - Mouse Cursor, Click Object In-World and Highlight Material - EP 3") ](https://www.youtube.com/watch?v=KakLXqpwnjo)

---

<div class="post-metadata">

**Author:** ![Shmoopy1701](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shmoopy1701/32/1194536_2.png) [@Shmoopy1701](https://forums.unrealengine.com/u/Shmoopy1701)\
**Post date:** [March 11, 2025, 6:02pm UTC](https://forums.unrealengine.com/t/how-to-make-a-thin-line-material-for-bounding-volumes/2339583/3 "2025-03-11T18:02:26Z")

</div>

Easiest would be something like: add a box/volume component to your actor, check Hidden In Game, and update the box size in PostEditChangeProperty().

---

<div class="post-metadata">

**Author:** ![glitchered](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/glitchered/32/768299_2.png) [@glitchered](https://forums.unrealengine.com/u/glitchered)\
**Post date:** [March 11, 2025, 8:03pm UTC](https://forums.unrealengine.com/t/how-to-make-a-thin-line-material-for-bounding-volumes/2339583/4 "2025-03-11T20:03:56Z")

</div>

found this there. [What are the methods avaiable to draw lines in unreal engine? - #32 by Supremative](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/32)

this material could help.

the convoluted way is to create the quad wireframe mesh manually using a procedural mesh. there is no line list render mode available, tho. you’d have to build it out of polygons. and those would not scale accordingly to camera depth.
