While following the creation process for global shaders in a plugin ( https://docs.unrealengine.com/en-US/Programming/Rendering/ShaderInPlugin/QuickStart/index.html )
An essential step is left out. In StartupModule the Shader path has to be added using AddShaderSourceDirectory. Without that, the lines like here:
IMPLEMENT_SHADER_TYPE(, FLensDistortionUVGenerationVS, TEXT("/Plugin/LensDistortion/Private/UVGeneration.usf"), TEXT(“MainVS”), SF_Vertex)
in the docs will not work, as the path is unknown. An example of how to do it is found in the LensDistortion.cpp