Landscape Alphas + Math -> Texture

I have a landscape. In this landscape are layers (¬_¬).

For each layer I can happily output it’s painted alpha to a file vis-a-vis (shift-2, Landscape-tab → Paint Subtab → right-click layer → ‘Export to file’).

However, I have a slope-aligned material for rocks, dirt, grass, etc and height-blends and the like. Past exporting painted-alphas, I need the material on the actual landscape-mesh for all the successive maths, slope-stuff to be sorted and come out all correct. The only place I can think to push it is to the RVT… Whenever I do so, anything I can extract from the RVT is somewhat blocky in parts, SHARP in others…

I’ve tried pumping out to a render-target via a material but that yields the same results.

I’ve disabled compression to remove any artifacts, tried to use just a BaseColor RVT to make it simpler, etc, etc. Nothing I do seems to work well.

Any suggestions how I can capture this kind of information? Painting is great, but some additional math can go a long way, I’d love to be able to capture this…

I believe some marketplace products might be able to do this? Am I missing an obvious solution?

Why do you need all this information outside the engine?
(I’m not saying you shouldn’t need this, just wanting to understand.)

One thing you could do is export the height information, and calculate the slope yourself.

I don’t need the information outside the engine, it’s for (material) optimization.

My current landscape material is dynamic based on a number of things, but it’s high in sample-count. A few height-blends multiplies everything you plug into grass-nodes, physics-nodes. The RVT output makes everything jump as well.

In many places for my project this is fine, desirable, some things change over time so it’s respected in the material; great, I can live with the cost for that. But for other things, I don’t need the dynamic-ness, I need the post-math alpha, and I can afford to ‘freeze’ it for some levels; they don’t change in any way. Hence a static-texture would be ideal, I can just chop out all those maths and stick a texture-sample out, which 1-of is much cheaper than sampling landscape-alpha, running maths, height-blends, etc, etc. REALLY cheaper :smiley:

So! being able to get the end-result to something static (pref-texture) would be ideal.

That I could do yes, but there is also the need to get the rest-of-the-math for how i want to tie it all together. It’s not just a straight-heightblend, but some stuff on blending basecolor this way, and normals that way as some stuff lies ‘on top’ of other stuff, etc. It sound picky, but even if I just multiplied the layer-alpha by 1.231, I’d still need a way to pick up that change…

Ultimately, if I can get a texture for those alpha-layers, I can save 10’s of samples and a decent amount of instructions; never a bad thing…

Understood. The best I can think of is to make the material output the value as grayscale, and then put an ortho scene capture 2D camera in the level that you can use to capture a render target, and then export that as texture. Getting it to line up perfectly will require some careful tuning. Also, remembering to re-do it all when you change the terrain or material function is a pain … I’ve done this for mini-maps, not for material re-baking, but I think it could be made to work. Ortho projection being the important part!

I will try this. I had thought to initially, but before I wasted time tuning it… Thanks. I’ll update the thread.

Too bad Unreal doesn’t have any kind of LandscapeAlphaOutput node to make all that stuff available in materials, or if the RVT/SVT could be right-clicked, and export to texture like other items.

LOL, the scale of things is working against me. One has to keep increasing the resolution of the projection to even see SOME of the landscape…

Going to try using a smaller plane and render the RVT across that vs a landscape.

Still kind of bummed that there is no alpha-out to all of this. With modeling-in-the-engine being a thing in UE5, I’d kinda like to see a “bake-material-to-texture” but for something applied to a mesh, in case maths take advantage of and local-features; vertex-normals, or the like. For any mesh, in this case it happens to be a landscape…

Nein!

I got the RVT and the small-plane working, got it tweaked right up to the edges of the render-target so alignment and resolution is good.

Odd, but I had to use an ortho-width of 800 to an RT of size 2048x2048… :man_shrugging:

Still however, I get blocky results. One can even see the RT chunkify in parts in realtime as the RVT updates. Even if I use a Mip of 0 in my RVT sampling material, it still blocks out in places.

It seems just going through the RVT at all is problematic outside the landscape, in-game, even then.

Is there a way to force/freeze the RVT to spit something out a full resolution?

Maybe you already tried it, but could you use the material layer blend functions directly, and make then blend between “black” and “white” or something, and use that as the “alpha”?

You mean alpha the alpha as color? Yes, this was what I was trying with the RVT. But then how would I get it out to a texture? So far as I understand it the right-click a paintable layer (shift2-mode) only exports the painted alpha, not the alpha going into a landscape blending node?

I’ll try that path and see what I can get, but am I missing something? I still don’t think I’ll get the math applied post layer-sample?

You’re probably right – I’m just throwing spathetti at the wall now :slight_smile:

The ortho width of the camera should presumably be the same as your physical block size, to make the capture texture match up? Maybe your blocks are 800 units wide? That’s the best I can think of.

Or do something horrible like using an asset ripper type plugin (or D3DDebug in visual studio) to simply copy the RVT or render target texture out, after rendering the alpha to black/white. It might work as a hack, but not as a well-defined long-term art path …

D’oh… I knew this, once upon a time. That was it.

Thanks. This is pipeline-able as I can make a material-path behind a switch to turn things on and off and I already have a BP to size, position, cap w/scenecap.

Thanks!

1 Like