# How to chamfer edges with shaders

**URL:** <https://forums.unrealengine.com/t/how-to-chamfer-edges-with-shaders/123413>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [March 11, 2019, 10:10am UTC](https://forums.unrealengine.com/t/how-to-chamfer-edges-with-shaders/123413 "2019-03-11T10:10:07Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![amoser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@amoser](https://forums.unrealengine.com/u/amoser)\
**Post date:** [March 15, 2019, 6:14am UTC](https://forums.unrealengine.com/t/how-to-chamfer-edges-with-shaders/123413/3 "2019-03-15T06:14:40Z")

</div>

The reason this is difficult is that generally, a bevel effect requires access to normals and edges outside of the current pixel which generally can’t be read directly from a material.

That said, since the shape of spheres and cylinders are known in advance, it is possible to make something along these lines, although it doesn’t seem like it would be a great approach.

This isn’t a complete solution, but here’s a quick example of beveling the corners of a cube by constraining vertices to a specific radius (i.e. a sphere). There are some unfortunate limitations to doing it this way, though, such as the fact that tessellation needs to be enabled to allow new vertices/edges to be created.

Is there a reason this needs to happen in a material specifically? This seems like the most roundabout way of achieving this effect.

 ![CubeCorners.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/d/9d3ef49fe88b6118f28568c9c7f2877d4842dce3.jpeg)

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-chamfer-edges-with-shaders/123413)._
