Material slope on spherical worlds

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!

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.

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 :confused:
I’m trying to find a solution…

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.

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

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?

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 :slight_smile:

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

what am i doing wrong :(?

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