Translucent Dynamic Material Instance, Shader Map

Hi,

I’m struggling with a problem since a few days that hit us when I upgraded our project to UE4.23, although at this point I’m quite sure that it’s not an engine bug but a problem related to our project, as other projects (i.e. Ocean Project GitHub - UE4-OceanProject/OceanProject: Environment Plugin Project (Ocean Simulation, Sky Simulation, Buoyancy, Time, Fish plugins for Unreal Engine 4)) work perfectly fine…

For some unknown reason our project crashes when we’re using a Dynamic Material Instance of a translucent Material on a static mesh (Mobility = movable). And it crashes in any “Play Mode”, Standalone, New Editor Window. Also ANY translucent material will cause it, on ANY static mesh, as long as it’s a Dynamic Material Instance.

Initially the error in the screenshot below came up when the editor crashed (in ShaderBaseClasses.cpp). The comment right above it might be interesting where it mentions “UE-75466”, but I wasn’t able to find a known issue with that tracking number. As a next step I’ve commented that line out to dig deeper into the problem.

Once that was commented out the error below comes up:

Which leads us again to

The two shader maps should be identical (see ShaderBaseClasses.cpp Line 114) but for some unknown reason “CachedUniformExpressionShaderMap” returns 0000000000000000

And here I’m getting lost, would be great if someone could come up with an hint what could be the reason for this error. Or maybe what Issue UE-75466 was, as it might be related to it. In the posted logfile it also says “TBasePassVSFNoLightMapPolicy”, might that be a way to a solution? Thanks! :slight_smile:

Here’s the link to Issue UE-75466, if someone is struggling with the same error https://issues.unrealengine.com/issue/UE-75466

Update, it was indeed a minor bug which should be fixed for UE4.24, Mihnea Balta from Epic Games fixed it rather quickly.

According to him:

The crash happens when these two events happen during the same tick:

  • a parameter of a instanced translucent material changes

  • the reflection cubemap for the sky is recaptured

So as a temporary solution it worked for me to set r.DeferUniformExpressionCaching to 0, and it would also work to just use some logic to avoid that the sky gets recaptured while any parameters of an instanced translucent material in the sky changes.
Or just wait for UE4.24 :slight_smile: