Simple custom ray tracing example.
Change list:
Engine\Shaders\Private\Custom\CopyDepth.usf
Engine\Shaders\Private\RayTracing\RayTracingCustomDepth.usf
Engine\Source\Runtime\Renderer\Private\DeferredShadingRenderer.cpp
Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingCustom.cpp
Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingCustom.h
Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingCustomDepth.cpp
Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingCustomDepth.h
Simply copy them to the path to check the effect.
Use r.RayTracing.CustomDepth for toggling.
Implementation explained in my WordPress post. (Link on my profile)