# Shape-independent edge texture fade

**URL:** <https://forums.unrealengine.com/t/shape-independent-edge-texture-fade/437074>\
**Category:** Rendering\
**Tags:** edge, unreal-engine, fade, question\
**Created:** [November 5, 2018, 5:40pm UTC](https://forums.unrealengine.com/t/shape-independent-edge-texture-fade/437074 "2018-11-05T17:40:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_89b2f182](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_89b2f182](https://forums.unrealengine.com/u/anonymous_user_89b2f182)\
**Post date:** [November 5, 2018, 5:40pm UTC](https://forums.unrealengine.com/t/shape-independent-edge-texture-fade/437074/1 "2018-11-05T17:40:00Z")

</div>

Hello, I’m trying to make a mask that would fade one texture into another towards the edges somewhat independent of the objects shape, the expectation is to achieve something like the first image. Red lines are UV seams.

With the attached graph I managed to get the result in the third image, UV’s were laid out as in the last image, not at all to my liking.

This way would also force me to use world-aligned textures to combat the stretching of the bad unwrapping, and all kinds of issues further on.

How should I go about actually achieving my expected result in a proper way?  
I would appreciate all the help I can get.

![258621-expectation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/4/954834cef1b72dae06610d8083d43bb60d4319b7.png)

 ![258622-graph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/c/f9c8352883168475f04c56c73c0f0b9badd3cf83.png)

![258623-result.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/a/21a2e20658172be13b88178811ee628e570c4ee3.png)

![258624-uv.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/0/9400738e0896a65a8ac522167fd900f31191f0da.png)

---

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [November 5, 2018, 9:32pm UTC](https://forums.unrealengine.com/t/shape-independent-edge-texture-fade/437074/2 "2018-11-05T21:32:56Z")

</div>

Your best bet would be doing it in pre-processing step in your content creation package by encoding distance to nearest edge into additional UV channel.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_89b2f182](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_89b2f182](https://forums.unrealengine.com/u/anonymous_user_89b2f182)\
**Post date:** [November 6, 2018, 3:56pm UTC](https://forums.unrealengine.com/t/shape-independent-edge-texture-fade/437074/3 "2018-11-06T15:56:08Z")

</div>

I don’t quite follow what you mean with encoding distance to nearest edge into UV, could you explain a bit further what that means?  
I haven’t really stumbled across that during the time I’ve used Blender.
