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 ?
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.