So, I was under the impression this was already a thing. Honestly, how is it not?
The theory is simple. The engine is already doing all the distance math it needs under the hood to render shadows. If you have dynamic on and a skeletal mesh the shadows cast up to the distance the dynamic light uses cascade for.
Past that distance its common to have DFAO take over - since performance does matter.
The engine is already doing all of that math to disable the shadow, and has no distance field to take over.
now, why can’t we just feed a distance field of our choice into the skeletal mesh? The static mesh has this function. Why and how does a skeletal mesh not?
Luckily My distance stuff is blueprint based, so i can pop a specifically set static mesh in there that doesn’t actually render but provides the shadow take over.
However, I find the lack of this functionality very strange - if I had not said so already - am I missing a setting somewhere?
should this become a feature request?
By doing this wouldn’t you end up with significant self-shadowing artifacts because the distance field won’t match the skeletal mesh as it animates? I feel like you’d be better off using decal shadows. Since the sunlight vector is accessible via the material graph you could inexpensively orient it to give it directionality too.
No artifacts so far.
The shadow just doesn’t move, which is ok.
Its something moving minimally at a distance greater than what you can notice.
having the shadow makes it so you don’t notice. Because the shadow would otherwise be completely gone (And the item is swapping from static to blueprint at runtime).
Having the shadow move is a limitation of the hardware.
Eventually I would assume the limitation will be gone when ray tracing becomes a real thing for everyone/everything.
If you have to have distance fields though, then a way to feed a custom DF into a skeletal mesh should just be provided considering how easy it is in theory.
Yeah but that’s the problem, the shadow doesn’t move so it will cast shadows onto the skeletal mesh itself, not just the floor
Makes logical sense, but It’s not what’s actually happening.
Probably has to do with the angle of the light. Regardless, an IN Engine option for the skeletal mesh would obviate that particular issue, by not shadowing the object itself…
Pretty sure you possibly can attach DFs to meshes. Seems useful for armor n stuff, even better for voxels.
Distance fields are hard to animate. Dreams (PS4) seems to use and animate them, so I guess it’s possible. And there’s some sort of animated distance field (capsule man?) going on with the player character in the UE5 demo.
So your idea is sound, and if you want to hack it I’d look at capsule shadows. At a distance they might look fine, The Last of Us II just brute forces a lot of capsules onto its main character for reflections and stuff so you might be able to do the same. But if you want better it looks like you’ll have to wait for UE5.