# Question regarding river Shader creation - how to create a Dynamic mask based on the angle that works with Splines and texture panning??

**URL:** <https://forums.unrealengine.com/t/question-regarding-river-shader-creation-how-to-create-a-dynamic-mask-based-on-the-angle-that-works-with-splines-and-texture-panning/1918578>\
**Category:** FX\
**Tags:** unreal-engine, question\
**Created:** [June 27, 2024, 1:28pm UTC](https://forums.unrealengine.com/t/question-regarding-river-shader-creation-how-to-create-a-dynamic-mask-based-on-the-angle-that-works-with-splines-and-texture-panning/1918578 "2024-06-27T13:28:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GladarkGamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GladarkGamer](https://forums.unrealengine.com/u/GladarkGamer)\
**Post date:** [June 27, 2024, 1:28pm UTC](https://forums.unrealengine.com/t/question-regarding-river-shader-creation-how-to-create-a-dynamic-mask-based-on-the-angle-that-works-with-splines-and-texture-panning/1918578/1 "2024-06-27T13:28:00Z")

</div>

Hi,

Since some time ago I have had this issue and I tested a lot of things to solve it, but I never found a solution to it, and I thought that maybe I should post it here.

Currently I am creating a river shader that works with a spline, my idea is to make a mask that detects that is the next part of the spline is a slope, so I can use that information to make the panning of the texture quicker (to simulate water physics), but when I do this the UV values goes nuts or makes weird seams.

The only solution I found is to floor the values, but that makes the tiling very noticeable, so isn’t the ideal solution.

For reference I will upload photos of the shader and my code.

\*Also, for the project’s needs, I need to use a Shader that I already made, so I am not interested in using the ones that Unreal has built-in.

 ![Captura de pantalla 2024-06-27 092103](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/4/4c4dbcab9a09d8a92a9a3b5c0556750a9cfdefef.jpeg)  
 ![Captura de pantalla 2024-06-27 092223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/d/4ad9e5dac4455b062568472b675a6c58e91ae825.jpeg)  
 ![Captura de pantalla 2024-06-27 092240](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/b/1/8b1292bda0a94eba7b68c65a3f97bf57858c525e.png)
