Get Landscape height in material applied to a static mesh

thanks for the breakdown Deathrey :slight_smile:
indeed I had the impression you’d need to modify the engine for that (sadly means most of us won’t get to try it)

and yes that texture is a demo from megascans, it’s the same texture that’s visible in my decal example above :stuck_out_tongue:

@Maximum-Dev the process is quite simple to already get to the point I showed.
I have a decal the size of the mesh. I put it just slightly on top of the landscape centered at the mesh and so it just naturally fades out vertically.
then the decal material has the same textures/params as the landscape, except tessellation is off since it doesnt work on decals (but it naturally projects on top of the landscape’s own tessellation)
the one thing that’s important here is that both the landscape and the decal have the textures’ UVs coming from the worldposition XY, and that’s why the landscape and the decals match 100% - btw this causes landscape displacement to only work “upwards” rather than “towards the normal” but there’s a workaround

after having the proof of concept working I made a blueprint that will populate the decal material’s params from the landscape’s own params based on a hit trace result. so now I can move the decal around and it will automatically change the material to match the landscape layer underneath.
of course for that to work you need to have landscape layers with physical materials assigned (if your AL stuff is any indication, you won’t be able to do it like that)

the above test was done placing a single decal manually. after that I also made a blueprint that will place multiple decals around the mesh (based also on traces to get something of a silhouette of the mesh, and the correct placement in relation to the landscape), so I can already have multiple decals adapting my mesh to different landscape layers automatically
at this point the ‘multiple decals’ thing is quite rough though. the amount of decals don’t quite conform to the shape of the mesh which leads to many unnecessary decals.

at this point I’m struggling between “automatic placement” and “efficient placement” for my decals, specially regarding drawcalls. in the perfect world the system would determine if there’d only be need for one layer underneath (and so just use one decal), or determine and conform a minimal amount of decals (basically one per underlying layer). just not quite there yet :slight_smile:
all in all I find this method more simple and efficient workflow-wise, while performance-wise I think it’s just a legit tradeoff (have to keep drawcalls under control).