Destructible (apex) not casting shadows with dynamic lights

Hello there,

I need a hand here please.

Lighting is done with a directional light set to “stationary light”.
The stationary light has cast “static shadow” and cast “dynamic shadow” activated + “dynamic shadow distance stationary light” and I’m in the correct radius (therefore I get shadow on the destructible pillar with dynamic lighting).

However as you can see the pillar does not cast any shadow.
(The pillar is an apex mesh done with apex lab).
The lighting settings on the pillar itself seems okay as well (screenshot).

The engine scalability settings are all set to “epic”

Am I missing something or is that a bug ?

(btw Unreal Engine 4.6.0)

Thanks !

Hi Max4dmoon,

Thank you for reporting this! I tested this this morning and found that this does appear to be a bug. I’ve entered a ticket for this (UE-8739), but there is no timeframe for when this will be investigated and fixed.

I will update here when a fix has been submitted and verified as fixed.

Thank you!

Tim

Thanks for the answer and the ticket !

Update:

Something specific to destructible that I missed initially is to enable “shadow casting” on the material (see screenshot).
This make it work when the mesh is unaltered (therefore my first report is wrong) BUT there is a shadow bug anyway with the chunks (which are not casting any shadow even with the right settings).

Nice catch. I actually wasn’t aware of that. It seems that by default when these are imported this is not turned on vs the meshes that are created in editor that have this turned on.

I’ve emailed a couple of the engineers that work with the destruction code to see why there needs to be option in the material vs the details panel like other meshes. The bug here would be that these aren’t on by default, but I’m glad it can be turned on and you’ve taught me something int he process! :slight_smile:

I’ll get back to you when I hear back from them, as I’m curious to the “why” for the reason cast shadows is here instead.

Thanks for updating!

Hello Tim,

Well I deserve no medal ^^
Our engineer found out about that after looking at the code in an attempt to debug it, he crawled back to the GUI and showed it to me but as he pointed out there is a weird behavior between destructible and shadows anyway

Here is a dynamic light with a destructible mesh (unaltered)

Everything is fine, shadow casting (thank to the “weird” material setting)

Now below, I’m just hitting play (two different sessions) and shooting at the pillar.
Sometimes I get the shadows on the chunks and it stays… and sometime I get the shadows for a very short moment before it “dissolves” away (but as you can see the pillar is still casting shadow)

In other word I get shadows 100% of the time on Destruction depth 0 and sometimes I get shadows on Destruction Depth 1 and below.

Note: No crumbling chunks or despawning settings on the destructible mesh itself which could explain this behavior.

Hello Hello,

I work with Max4dmoon (I’m an engineer) and I’ve been looking into the shadow problem from my side.

I think I’ve figured out why the shadows sometimes dissolve somewhat randomly after a few seconds when the destructible is broken. We use stationary directional lights with a non-zero dynamic shadow distance. From what I understand, the destructible is rendered as a single skeletal mesh with a number of visible/unvisible bones for each chunk. Turns out that the simulation will sometimes take some of the chunks through the collision mesh, letting them fall into the void. The bounding box of the skeletal mesh then grows to the point where it will be taken beyond our dynamic shadow distance for the directional light. That’s when the shadow dissolves.

So it seems that we either need to prevent the chunks from falling through the collision, disable them if they fall beyond a certain distance or break the skeletal mesh into several meshes if the chunks fall too far from the origin of the originating mesh. Obviously that last solution seems to be the less trivial one.

Any recommandations?

Hi PhilPix,

I don’t have any specific recommendations regarding that at the moment. I can add the notes though. Destruction in the engine still has a ways to go. While the majority of stuff is working there are still some known issues and areas that really need to some attention as well.

On our UE4 Trello Road map there will be a dedicated time of focus to get destructibles in a more suitable position. However, there isn’t a specific ETA for this due to other higher priority features at the moment.