Virtual Height Field Mesh no Cast Shadow

Hi!
I’ve been around the forums and docs for an answer, is shadow casting on VHM disabled/broken? The guides mention only drawing the driving landscape in the RVT pass, and that only makes sense if the VHM can cast shadows. I can’t rely on the landscape for shadows, since I do some more manipulation of the height data. I only use the landscape for collision.

Tried both CSM and VSM. If this is another feature left to die, what else can I use? Bear in mind I can only use Blueprints, but I’m pretty good with those.

No shadows, whatever settings I try (normals etc. work fine):

Landscape turned on, casts proper shadows.

@Frenetic hey, you made a guide on this topic. Did you get shadows?

I DID fix my issues with shadows, it had to do with my lighting settings, specifically the ‘Dynamic Shadow Distance’ on the directional-light that is the Sun in Ultra Dynamic Sky. Since the default is 40k units, and I was zoomed-out all the time, the dynamic shadows were simply too-far away to be drawn in.

To help resolve, I found that setting, as well as the cascaded shadow-maps have an impact here.

And yes, it’s the underlying landscape that appears the generate the shadow. The ‘casts shadow’ setting on the heightmesh itself is seemingly non-functional (?). I toggle it on and off in various places and can’t see a difference…

here are my current settings:

Pic

and backing up a bit to something more than 40k units, you can see the shadow of the cube is gone, but at least the far-shadows on the landscape still remain:

Pic

That far part of the screen on the top-left is ~10km away in world-units. Still has shadowing :smiley:

Pic


Note the terminus of the shadow on the cube, I moved it to prove out it’s being properly lit.

EDIT: totally forgot, sorry! But you also want to enable ‘hidden shadow’ on your landscape. as, at least the way i am doing it, the landscape is never rendered, only used for the projection into the RVT and for collision, but since the heightmesh won’t make shadows, the landscape still needs be drawn in the main-pass for lighting.

Pic

1 Like

Hey!

Thanks for your reply! Good reminder that CSM go over to distance field shadows after a certain distance. That wasn’t my issue, but you have confirmed that too:

Yes :confused: VHMs are probably a dead feature, considering how old and broken they are.

The “cast hidden shadow” was a good tip! However, I have snow deformation happening live on the heightfiled, and so having that old landscape cast shadows won’t work, my trails will be unshadowed.

I’m still in 4.27 on my dev branch, and I did try VHMs there too. They DO cast shadows properly. But the tech feels unfinished, and each border between LOD levels shows visible artifacts because how abrupt they change. Not like good 'ol tessellation. So, seems like I’m stuck with 4.27 and tessellation.

Nanite-landscape has been another hope, but shadows look awful on them. CSM has soft gradients, but look very glitchy. VSM look flat/binary (worse), and also has glitches. Maybe it will be another few years until the next gen really is as solid as the old paradigms left behind in 4.27. Unless you specifically want to do the type of maps, with the workflow that epic does, full of nanite rock meshes.

But yeah, if you don’t change the heightmap, your solution works.

Probably. There is a ‘next-generation-landscape-solution’ out on the product roadmap.

Still, I see lessons-learned on the shader-side of things that should directly apply to whatever is coming down the pipe. I can take what I have today for a heightfield mesh and slap it on a nanite landscape, still works, but less performant.

With tessellation and deformation back in the mix, hoping whatever I have now would be a practical 1:1 transfer over to the new tech.

This is much-better in 5.x as instead of two distinct tessellations on top of one another, the engine fills in and breaks-down each triangle at the border, discretely:

Pic

I’ve done the snow-thing, with trails in the heightmesh; I was even thinking of making a dynamic, shallow-water solution as well…

Depending on how much you deform the landscape, snow will still work w/shadows. The heightmesh shadow’s itself properly, so any deformation in the snow-layer, in the heightmesh should work. It did for me.

Insofar as shadows I’m finding the virtual-shadow-maps working well, and performant. Here, w/Lumen, I’ve got a pair of ~1km tall spikes (I just held the raise-terrain button down a bit), to test out distance shadows. Notice how at the base, the shadows are very sharp and they feather/blur as you travel away from the shadow caster (right side of the screen). Looks nice to me!

Pic

I’m a bit confused, I thought we established that the heightmesh doesn’t cast shadows, but you need the landscape to cast hidden shadows for that, has that changed?

For snowtracks I really need working self shadowing, like this:

Just shading of areas facing away from the sun doesn’t cut it:

That next gen landscape solution… cool but it’s far away I think.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.