Using C++ shaders from within a plugin

New: Global Shader Support For Plugins

You can now add new global shaders
inside of Plugins and Projects! Taking
advantage of changes made to the
shader compiler and shader directory
file structure, Plugins and Projects
can provide their own Shaders. You can
look at the LensDistortion plugin for
a simple example
(Engine/Plugins/Compositing/LensDistortion).

Notes:

Plugin and Project modules that have
global shaders require use of the
PostConfigInit loading phase. Shader
support in Plugins and Projects is
still experimental. Plugins and
Projects can include other plugins’
USH files in the Public directory
freely. It is the responsibility of
the Plugin author to handle
inter-plugin dependencies correctly.
USF files should only be located in
the Private directory. All calls to
IMPLEMENT_SHADER_TYPE, should now
include the full path of the USF
shader file (e.g.
“/Engine/Private/Foo.usf” or
“/Plugin/FooBar/Private/MyComputeShader.usf”).
C++ Generated files should be mapped
within the /Engine/Generated/ virtual
directory. Shaders/ directory requires
at least a Private/ or Public/
directory. The Generated/ directory
should not exist.

4.17 release notes