# Material slope on spherical worlds

**URL:** <https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239>\
**Category:** Rendering\
**Tags:** planet, unreal-engine, question, Blueprint\
**Created:** [October 5, 2017, 1:20pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239 "2017-10-05T13:20:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon51614225](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon51614225](https://forums.unrealengine.com/u/anon51614225)\
**Post date:** [October 5, 2017, 1:20pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/1 "2017-10-05T13:20:49Z")

</div>

Hi everybody!

I would like to create a material which change per terrain slope to see cliffs/plains/mountains…etc.

I can do this with a landscape (with lerp and world aligned blend). But I don’t know how to do the same effect on a spherical landscape like a planet.

Any idea is welcome! Thank you!

---

<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:** [October 9, 2017, 4:39pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/2 "2017-10-09T16:39:51Z")

</div>

Well, you should follow more or less the same way. Blend mask would be obtained by taking a dot product between vertex normal and world up direction in a classic landscape case. For a spherical world, everything remains the same, with exception that world up direction varies with location.

---

<div class="post-metadata">

**Author:** ![anon51614225](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon51614225](https://forums.unrealengine.com/u/anon51614225)\
**Post date:** [October 10, 2017, 11:00am UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/3 "2017-10-10T11:00:23Z")

</div>

Quite simply… I could have looked for weeks! Thank you very much Deathrey!

**EDIT:** Oops! This is half-resolved because my entire world is in rotation on itself! So the material changes with this rotation 😕  
I’m trying to find a solution…

---

<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:** [October 10, 2017, 11:45am UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/4 "2017-10-10T11:45:21Z")

</div>

Take your world up vector, and rotate it with RotateAboutAxis material expression using the same axis and angle, as you use to rotate the planet.

---

<div class="post-metadata">

**Author:** ![anon51614225](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon51614225](https://forums.unrealengine.com/u/anon51614225)\
**Post date:** [October 14, 2017, 6:46pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/5 "2017-10-14T18:46:31Z")

</div>

I tried a lot of things without any success. Details are welcomed 😉

---

<div class="post-metadata">

**Author:** ![Gampersnaz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gampersnaz](https://forums.unrealengine.com/u/Gampersnaz)\
**Post date:** [August 5, 2018, 11:10pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/6 "2018-08-05T23:10:19Z")

</div>

Sorry to bump and old issue, but I am looking for some clarification of this issue as well. When Deathrey said that the up vector varies by location on the sphere, how can that be expressed in a material graph?

---

<div class="post-metadata">

**Author:** ![Gampersnaz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gampersnaz](https://forums.unrealengine.com/u/Gampersnaz)\
**Post date:** [August 5, 2018, 11:40pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/7 "2018-08-05T23:40:19Z")

</div>

Ok I got it. I’m using the local position node normalized , and the pixel normal ws node normalized, and getting the dot product from that. add a multiply, power and clamp to control the falloff 🙂

---

<div class="post-metadata">

**Author:** ![HOUmmel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hoummel/32/1055696_2.png) [@HOUmmel](https://forums.unrealengine.com/u/HOUmmel)\
**Post date:** [October 16, 2018, 2:42pm UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/8 "2018-10-16T14:42:38Z")

</div>

somehow this does not work for me. this is what i get:

 ![256743-world.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/4/3a423c86fa668abcceb67476f12ecf1b6b8f4d7f.jpeg)

 ![256744-nodes.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/5/395383ed5a2aa3c62eda99594e325c948b92c016.jpeg)

what am i doing wrong :(?

---

<div class="post-metadata">

**Author:** ![HOUmmel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hoummel/32/1055696_2.png) [@HOUmmel](https://forums.unrealengine.com/u/HOUmmel)\
**Post date:** [October 17, 2018, 10:28am UTC](https://forums.unrealengine.com/t/material-slope-on-spherical-worlds/406239/9 "2018-10-17T10:28:14Z")

</div>

never mind i found the problem. i used wrong normals uvs tangents etc. in my sphere creation function
