Ray Tracing support using the Vulkan RHI (4-27 & 5-0)

Hey there,

I was wondering if there are any plans to support Real Time Ray Tracing using Unreal Engine’s Vulkan RHI, considering that the Vulkan API supports it? As far as I know (though I could be wrong on this), Vulkan is the only way to implement Ray Tracing in games on platforms other than Windows (or Xbox).

P.S. - This goes for Unreal Engine 5 too!

5 Likes

This is definitely something I’d be interested in using, as RTXGI static volumes are not nearly as potent as their dynamic equivalent, and Vulkan is our all-platforms target RHI.

Considering Nvidia posted a tutorial on RayTracing in Vulkan, it may be viable to implement it as a community PR to 5 and potentially even 4?

4 Likes

Actually, looking into the source, it seems VulkanRHI has raytracing support in the ue5-main branch- perhaps it’s possible (or even practical) to backport the changes to the Engine/Source/Runtime/VulkanRHI to 4.27? See git diff --stat origin/release origin/ue5-main -- Engine/Source/Runtime/VulkanRHI/ to see direct changes- but related changes to code outside of that directory may prove more interesting/complicated.

Any commentary from someone more familiar with engine code (maybe an official dev?) would be appreciated on this front.

2 Likes

I am using 5.0.3 on linux and tried a unbounded post process volume to test out ray tracing. There is no discernible change even when we enable the ray tracing (or path tracing) features. Also the official docs state that Windows 10 1809 or later is needed for path tracing.

I also noticed that Vulkan’s ray tracing extensions like VK_KHR_acceleration_structure and VK_KHR_ray_tracing_pipeline are found but are not being used by UE. This was verified by checking the application startup logs. 5.0 release notes mention that Vulkan ray tracing can be enabled by setting console variable r.Vulkan.ExperimentalRayTracing but it doesn’t mention the supported platforms. I am guessing it only works on windows because I couldn’t find that console variable on linux.

Considering all this, is it safe to assume that hardware ray tracing is not supported on linux even in UE 5.0 or UE 5.1?

I’m using 5.1 on linux and there is a console variable called r.Vulkan.RayTracing.

2 Likes

@ezgoin thanks for the info! I will try with 5.1 and see if it works.

If you don’t mind sharing, after setting the console variable r.Vulkan.RayTracing, do you see path tracing as a view mode for the level viewport like the one in the image below?

You’re welcome. Yeah i enabled it and seems to work fine.

I am totally impressed by the performance on linux. It’s twice as fast and so much more responsive.

2 Likes

Thanks for the update! One last thing, do you mind sharing what GPU you are using?

I have a rtx 3060 on debian testing with driver 510.85.02 and the 5.1 source.

1 Like