Geometry Nodes - procedural textures based on height displacement (Noise Texture)

Hey guys,
learning Blender at the moment and testing my fitness level :slight_smile:
I’m trying to create a tiny planet, based on a Icosphere which I’ve displaced on normals with a noise texture within the Geometry Nodes.

I’m struggling with texturing the mountains. How can I manage to have only the mountain tops with a snow texture, and a sand texture close to the water level?

I’m able to change the water level within my Geometry nodes (second Icosphere which I can resize), and I want to have the textures being blended automatically based on those parameters.
So basically kind of a Color Ramp maybe?

How can I get the height information from my generated planet sphere into the shader tree?

(To remove the trees from the water level is a second issue, but I’ll try to solve that later)

Thanks a lot for your help!

Best
Wolfram

1 Like

You can connect any value to the group output geometry node. If you set a name in the attribute field you can use it in the attribute shader node:

What is really important in this particular setup is the “capture attribute” node. In my first attempt, I connected the output of the noise texture directly; the problem is that this texture evaluates 3D coordinates and is therefore affected by the displacement. But by capturing the attribute, the height value gets attached to the vertices before they are displaced.

geonodes_terrain_1_v01.blend (109.2 KB)

Edit: only the name in the modifier tab setting is relevant.

2 Likes

Oh thank you so much!
What I didn’t get is that you have to type in the “Height” (or whatever) again in the modifier stack in order to get it working in the shading editor!
And I only slowly understand how to use the Capture Attribute. And where-inbetween to plug it…
But with your screen shot I managed to transfer the nodes to my own scene and I think I almost understood it to use it again in another project in future :slight_smile:
So cool, you guys in the Blender community!

Best regards
Wolfram

1 Like