Unreal 5 Material Runtime Opacity problem with Shadows

Hello !

So I made a simple test level where I just change the opacity of some object material with a press of a button. But when the object disappears, its shadow stays on the level until I turn the camera around. When I turn the camera the shadows get cleaned up.
I tried the same test on Unreal 4 and it seems to work fine, the shadows disappear immediately along with the object when I change its opacity.

What can I do to force the shadows to disappear along with the object ?
ezgif.com-video-to-gif

This is due to Virtual Shadow Maps. Shadow data is cached, and only updated when certain events invalidate the cache. If the cache is not invalidated by the material change along, you will need to force an invalidation somehow.
This may require changing the objects mobility if it is set to static.
This is because normally a static objects shadow never changes and never needs to be invalidated, until the light itself moves.
Dynamic objects, like characters or meshes using WPO on the other hand invalidate the cache every frame.

You can also disable VSM and switch to CSM to get the same behavior as in UE4.

I already set the object to be Movable

Thank you ! Disabling the VSM worked !

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