How to prepare and initialize custom ref material for rendering thread? Got check(!bShaderMapComplete ) crash

Hey, I was try to extend the ’ class FSkeletalMeshSceneProxy ‘, and override the ‘Func GetDynamicMeshElements()’ which used a material passed from the component and for meshbatch . I got the crash info below. I believe it was like some race condition case. Just want to know if there has some instructs for preparing material complie for render thread in this case?

[2022.05.06-05.35.41:511][ 1]LogWindows: Error: Error reentered: Assertion failed: !bShaderMapComplete [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/Materials/MaterialShared.cpp] [Line: 2584]

1 Like