From what I can see from the engine, I see nothing wrong with what you have there.
The only thing I can think of, if you really wanted to test it. Move your files to /Plugins/Private? I can’t imagine that’s the issue, but unreal does hate long file paths.
EngineSnippet
IMPLEMENT_SHADER_TYPE(,FHdrCustomResolveVS,TEXT("/Engine/Private/HdrCustomResolveShaders.usf"),TEXT("HdrCustomResolveVS"),SF_Vertex);
Excuse me again, How to set the Shader file path in the Create a New Global Shader as a Plugin example?
The file path seems like it needs to be pretty static. Meaning you need the local folder path to look like Plugins/Shaders and nothing more nothing less
This also stands out
- If you get the error Can’t compile:
/Plugin/<MyPluginName>/<MyFile>
**not found.**Make sure to check your Plugin’s module’s LoadingPhase is set to PostConfigInit, and that there are no typo’s in the Plugin’s Shaders/ directory name.
Sorry I can’t be of more help, it looks like what you have should work.
I ran into this issue today, and through a lot of troubleshooting found the source of the problem, as well as a real solution.
The issue, which isn’t mentioned by the tutorial, is your shaders path that the guide had you create is not in the shader directory mapping. So, regardless of what directory you put in here, if it’s not a directory under the shader directory map in the engine, it will cancel loading the shader file.
The solution: Manually add your plugin to the mapping.
#include "Modules/ModuleManager.h"
// Additional includes needed for mapping the shader source directory
#include "Interfaces/IPluginManager.h"
#include "Misc/Paths.h"
#include "ShaderCore.h"
class FFooModule : public IModuleInterface
{
public:
virtual void StartupModule() override
{
FString PluginShaderDir = FPaths::Combine(IPluginManager::Get().FindPlugin(TEXT("Foo"))->GetBaseDir(), TEXT("Shaders"));
AddShaderSourceDirectoryMapping(TEXT("/Plugin/Foo"), PluginShaderDir);
}
};
Check this if anyone meets link error on IPluginManager: IPluginManager::Get() Linker error - Not finding implementation - Pipeline & Plugins / Plugins - Epic Developer Community Forums (unrealengine.com)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.