# Procedurally generate a curved normals in shader?

**URL:** <https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988>\
**Category:** Rendering\
**Tags:** normals, sphere, unreal-engine, procedural, Shaders, question\
**Created:** [October 14, 2017, 5:29am UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988 "2017-10-14T05:29:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FishMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishMan](https://forums.unrealengine.com/u/FishMan)\
**Post date:** [October 14, 2017, 5:29am UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988/1 "2017-10-14T05:29:20Z")

</div>

Hi. Does someone know how I can generate curved normals on the plane using shader logic?

I don’t want to use any normal map, I want to generate normals using for example texcoord node or something else.

To get normals simlar to a sphere for example…

Then I want to transform it to world space and use it with dot product to get a fake reflection like this…

[https://i.imgur.com/1ulgzvh.png](https://i.imgur.com/1ulgzvh.png)

But I can’t figure it with my self. Linear gradient doesn’t give the right thing and I can’t figure how I should distort it to get right normals…

---

<div class="post-metadata">

**Author:** ![FishMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishMan](https://forums.unrealengine.com/u/FishMan)\
**Post date:** [October 14, 2017, 6:37am UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988/2 "2017-10-14T06:37:11Z")

</div>

I’ve found this…

> **[Normal Material Input Bug](https://forums.unrealengine.com/questions/595500/normal-material-input-bug.html)**
>
> When putting something inside the normal input inside a material that is not a Normal Texture it requires a World To Tangent transform which makes no sense! Either it is required for normal textures AND everything else or for neither! Here I made a...

And after some study I’ve managed to shrink it to this:

 ![216633-shot-171014-101607.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/c/becb0ed42218d71820cb43489baa3b6c77f19644.png)

And it looks like this:

![216638-shot-171014-101607.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/6/3d6327f4c71c12ded0f15324943f0b6acd0fd90d.png)

Still not sure how I should manage the curvature of the normal O\_\_o

Other words how I should do this?

 ![216637-shot-171014-101607.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/5/1c5a679f23ac1f53abbc769990bdb91bedc1aa8d.jpeg)

Any ideas?

---

<div class="post-metadata">

**Author:** ![FishMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishMan](https://forums.unrealengine.com/u/FishMan)\
**Post date:** [October 14, 2017, 6:25pm UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988/3 "2017-10-14T18:25:18Z")

</div>

Oh my god! Where was my head before?..  
I can just do it like this:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/2/ed27a40df98b826bceb9809437289f237c6d5eaa.jpeg) ](https://pp.userapi.com/UNYnEwq4K5R5amCkGQPsVQF3Czxn4AhhyDURWQ/rpJYfw9svVQ.jpg)

The question: “how I suppose to control the curveness of the sphere?” - is still open.

---

<div class="post-metadata">

**Author:** ![FishMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishMan](https://forums.unrealengine.com/u/FishMan)\
**Post date:** [October 19, 2017, 2:10am UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988/4 "2017-10-19T02:10:30Z")

</div>

So here is the solution I made at the end:

 ![217144-shot-171019-045531.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/e/10e109ff9b4d70c13117dad606ec0fdcb21fc200.png)

Using Parameters in Curvature Adjustments section you can change the curvature of the normal, for example make it look inwards…  
Here some results made using this shader:

 ![217145-shot-171019-045531.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/7/b47dfd76254bcf4608712e1468d0d13264dc8a34.png)

Pay attention that if you have a circular shape with a propper UV’s then you can get rid from “remove unwanted” section and save some instructions. Also linear radial gradient calculated using distance node can be used instead, but personally I like it more without the sqrt (Commented as Radial Gradient Mask).

Good luck…

---

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [April 19, 2025, 7:52am UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988/5 "2025-04-19T07:52:31Z")

</div>

thanks SO much for sharing the results and code!

---

<div class="post-metadata">

**Author:** ![FishMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishMan](https://forums.unrealengine.com/u/FishMan)\
**Post date:** [April 21, 2025, 4:50pm UTC](https://forums.unrealengine.com/t/procedurally-generate-a-curved-normals-in-shader/406988/6 "2025-04-21T16:50:09Z")

</div>

U’re welcome…  
I already searched this thread by my self multiple times because I forgot how to do it lol 😃
