How to get the heightmap from a Output Material Attributes node?

This is an issue that I think should be very easy, but I somehow didn’t manage to solve in many days.
The issue is, that my material layer contains a heightmap, but material layers only support one: Output Material Attributes output.
Meaning, by default my only way to access this output is through a GetMaterialAttributes node.
The problem is, this only supports a select few attribute types, none of which are height.

One of the attributes is WorldDisplacement. I originally though this is the solution, but this is a very colorful output and masking out the red channel just gives a very low-detail height information.
NOT the actual heightmap I want.

I have tried countless workarounds by now and none gave me the heightmap data I have in my material layer.

I NEED to access the heightmap for height blend layer blending, this is not optional.
So can someone please give me a solution how to do this?

Reason you aren’t getting any answers is that you are making 0 sense.

The landscape is made from (or generates) a heightmap.
This heightmap doesn’t have anything at all to do with any material.

Layers on the landscape can have a height blend and offset the verticis with world position offset.
This has nothing to do with the landscape heightmap.

Layers on the landscape can use a height blend - this is only used to visually blend Layers based on a texture so that the transitions between one material and another aren’t “sudden” and do not create clear lines.
They also have nothing to do with the landscape heightmap.

Rephrase your question?

Right, sorry for the confusion, I should have worded that more clearly.
I am of course talking about the layer’s heightmaps.
Accessing the information in those layer’s heightmaps in the main landscape material, to height blend the layers.

This question is not related to the landscape heightmap that defines the overall landscape shape.

I was unable to find a better solution. So for now I resorted to a workaround where I’m storing the heightmaps in the Metallic channel of the landscape layers.
Which I can then access via the GetMaterialAttributes node.

If anyone has a cleaner solution, I’d be very happy to hear it!
Otherwise, this workaround works relatively well for me, since there are no metallic things on my landscape.

I use R for roughness and alpha for height maps on the main texture.

The R for roughness has a mask parameter assigned in the function so that if I need to I can swap the channel to whatever looks better.

If you do 2 textures you tend to overload the shader / add complexity, and get less layers.

You can also use the alpha in the normal map though. But it won’t be treated by the engine as a normal map for compression. So there’s downsides to it.

Anyway, I think the answer to your question is that you ether make a material attributes in a function, then break the result and pull the height map value of whatever you plugged it into, or you just directly output it in the material function so you can readily connect it into the layer as a separate part.