Blueprint/Code driven landscape visibility?

Hi all,

Is it possible to change the visibility map of a landscape chunk in blueprints or c++ code?

What I’m trying to do: build into a blueprint or code snippet (I’m comfortable in either domain) the “erasure” of the underlying landscape where I’m placing the entrance mesh for a cave-spawning object. It’s always the same mesh, so I can define a constant size brush if necessary, or drive it from the collision mesh. The landscape material already has the right settings to support editor-painted holes in the visibility, but my end goal is to avoid using any landscape material painting in favor of plopping down a cave seed mesh and letting it dynamically grow at game launch, creating random cave systems. “Nice-to-have” would let me give that tool to players as a built in simplified map editor mode.

Thoughts? Thank you!

I know this is a very old thread but I am interested in this as well. From searching around this doesn’t seem possible but hoping UE5 introduced something? :crossed_fingers:

Might be possible to drive using RVT or a render target of your choosing and hooking that render target texture up to the visibility in the landscape material. I have no idea if it would work run-time though.

Resurrect a 5 year old topic to add nothing but silliness? Great work folks.

Its been possible to make cave entrances - including removing collision - since ue4.11 at the very least.

Look up tutorials online, there’s bound to be only about a billion.

Extrapolating from how you do it manually, to creating and setting up a render target to drive the actual landscape in real time takes maybe 10 minutes.

Anything that is driven by the material itself can happen in real time.

Anything that’s done by sculpting tools cannot.

This guy does it in this video: https://youtu.be/1U-5zxJCIN4?si=gCg7ARfqOEWSOw09&t=157
I’ve been trying to recreate this, with no luck :frowning: yet

Depending on if removing collision is done with a paint layer or a sculpting tool you should have the answer to the question of if it is possible or not to do it at runtime.

Either way, given how poorly the engine runs while using landscape I don’t really see any reason to delve into any of this.

Use something other than landscape.

Mesh can be cut up at runtime via c++ and the desired result is fairly trivial to achieve.
The cut out of just about any geometry shape is possible. Complex ones too. Unlike on landscape.

Just projecting the opacity to zero at an arbitrary point would suffice for me.
Was trying to achieve it with virtual textures, but I can’t make any sense of it :(.

Why would the landscape be poor? So instead of landscape what should be used? Just a plane with 1000 x 1000 division and deformed with noise? I did this but it renders insanely slow compared to just the world landscape.

You need to study up.
1000 x 1000 = 1,000,000 quods which = 2,000,000 tris. And Probably wasted tris at that.

Landscape is poor because it is pure and unmitigated ■■■■.
It was designed nearly 20 years ago for the second sdk and it has hardly had any worthwile improvement since then.
In fact, It had a lot of whatever the opposite of improvement would be - lets go with “sheer stupdity”. Which instead of producing a worthwile system made the whole thing heavier to render than it should be. By around 60 to 80%.

What you should do is produce an analytical mesh - where there are verts only where verts are required.
On top of that, usually you section the mesh(es) for occlusion following best practice standards.
So in the end you have like 2k tris on screen and a handful of drawcalls instead of 1 drawcall of 2m tris.

There’s some decent (of all things one would never think of mentioning EA after decent, but here goes) EA talks on geo-rendering. And there are some perhaps better ones from Edios (hitman).

Anyway, only removing visibility can definitely be achieved with just a material.
Lets see… if i find a link in the first search ill share it…
You are in luck

Oh that is a interesting one,
Was doing a similar thing with the material, with draw 3d box in the material itself, and using its coordinates to make the “hole”, which worked right aways, except I could not figure out how to stop each proxy of the landsacpe to also have a hole in it :frowning: and the coordinates were quite off from what I expeted . Took it from here “https://youtu.be/N_pq2RYTG04?si=s_k4WC0-Y4Jl9_Bl&t=362

the way he paint is the video you share is somewhat different, well maybe all that math with the map size and such is what I was missing.

Sad to know that the landscape is like “left a side” for 20 years. Most stuff I’m seeing are done with pcg over landscape and deforming landscape itself with pcg, and yet, landsacpe is that terrible as you mention.

Anyways, thanks for the feedback, wasn’t really expecting any answer from a topic that old.

1 Like

The proper math Murphy didn’t mention would be done using the Object Bounds.

You have to fuss with it because I dont remeber the exact formulae, but something like bounds x 2 divided the world position.

The result you want is that if you take a texture (any texture, any size), it is accurately stretched across the whole landscape actor you are currently dealing with.

The line trace process is likely still used to determine which landscape (or mesh) you are interacting with, so that coordinates/UV sizes can be adjusted for the render target you are using to work.

Actually you are in extra luck again. I found a screencap of the formulae.

Go play the lottery or something…

Obj position - obj bound defines one corner.
You subtract that from wpo so you get the starting point, then you count up the bounds to define the area of interest…

1 Like

holy fu@#, that is some weird math, I really need to try to make sense of it.
hey, thanks for sharing those, I’ll play with it in a bit