Couldn't find source file of virtual shader path

Hi echow!
I solved the problem finally. add the code in your StartupMoudle function.
FString PluginShaderDir = FPaths::Combine(IPluginManager::Get().FindPlugin(TEXT(“YourPlugin”))->GetBaseDir(), TEXT(“Shaders”));
AddShaderSourceDirectoryMapping(TEXT(“/Plugin/YourPlugin”), PluginShaderDir);

3 Likes